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

Function create_zipapp

tests/test_zip_utils.py:58–71  ·  view source on GitHub ↗
(
    tmpdir,  # type: Any
    comment=b"",  # type: bytes
)

Source from the content-addressed store, hash-verified

56
57
58def create_zipapp(
59 tmpdir, # type: Any
60 comment=b"", # type: bytes
61):
62 # type: (...) -> str
63
64 zip_file = os.path.join(str(tmpdir), "zip_file")
65 with open_zip(zip_file, "w") as zip_fp:
66 zip_fp.writestr("__main__.py", b"print('42')")
67 zip_fp.writestr("data.py", b"import pkgutil; print(pkgutil.getdata(__name__, 'data'))")
68 zip_fp.writestr("data", b"42")
69 zip_fp.comment = comment
70 assert_zipapp(zip_file, expected_comment=comment)
71 return zip_file
72
73
74@pytest.mark.parametrize(

Callers 2

test_header_isolationFunction · 0.85
test_sandwichFunction · 0.85

Calls 3

open_zipFunction · 0.90
assert_zipappFunction · 0.85
joinMethod · 0.45

Tested by

no test coverage detected