Lines Matching refs:archive
16 # because the resulting archive may be intended to be run under Python 2.
38 def _maybe_open(archive, mode):
39 if isinstance(archive, (str, os.PathLike)):
40 with open(archive, mode) as f:
43 yield archive
53 def _copy_archive(archive, new_archive, interpreter=None):
54 """Copy an application archive, modifying the shebang line."""
55 with _maybe_open(archive, 'rb') as src:
78 """Create an application archive from SOURCE.
81 object referring to an existing archive.
83 The content of SOURCE is packed into an application archive in TARGET,
88 The created application archive will have a shebang line specifying
96 # Are we copying an existing archive?
109 # We are creating a new archive from a directory.
150 def get_interpreter(archive):
151 with _maybe_open(archive, 'rb') as f:
167 help="The name of the output archive. "
168 "Required if SOURCE is an archive.")
179 help="Display the interpreter from the archive.")
181 help="Source directory (or existing archive).")
185 # Handle `python -m zipapp archive.pyz --info`.
188 raise SystemExit("Can only get info for an archive file")