MCPcopy
hub / github.com/pex-tool/pex / write_pkg_info_file

Function write_pkg_info_file

tests/test_dist_metadata.py:333–349  ·  view source on GitHub ↗
(
        location,  # type: str
        name,  # type: str
        version,  # type: str
    )

Source from the content-addressed store, hash-verified

331 )
332
333 def write_pkg_info_file(
334 location, # type: str
335 name, # type: str
336 version, # type: str
337 ):
338 # type: (...) -> None
339 with safe_open(
340 os.path.join(
341 location,
342 metadata_dir_name("{name}-{version}".format(name=name, version=version)),
343 metadata_file_name,
344 ),
345 "w",
346 ) as fp:
347 print("Metadata-Version: 1.0", file=fp)
348 print("Name: {name}".format(name=name), file=fp)
349 print("Version: {version}".format(version=version), file=fp)
350
351 foo_location = os.path.join(str(tmpdir), "foo_location")
352 touch(os.path.join(foo_location, metadata_dir_name("foo-100"), "bar"))

Callers 1

test_find_dist_info_fileFunction · 0.85

Calls 3

safe_openFunction · 0.90
metadata_dir_nameFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected