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

Function main

scripts/embed-virtualenv.py:26–37  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24
25
26def main() -> None:
27 out_path = find_repo_root() / "pex/venv/virtualenv_16.7.12_py"
28 with httpx.stream(
29 "GET",
30 f"https://raw.githubusercontent.com/pypa/virtualenv/"
31 f"{VIRTUALENV_16_7_12_RELEASE_SHA}/virtualenv.py",
32 ) as response, named_temporary_file(
33 dir=out_path.parent, prefix=f"{out_path.name}.", suffix=".downloading"
34 ) as out_fp:
35 for chunk in response.iter_bytes():
36 out_fp.write(chunk)
37 os.rename(out_fp.name, out_path)
38
39
40if __name__ == "__main__":

Callers 1

Calls 3

named_temporary_fileFunction · 0.90
find_repo_rootFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected