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

Function statically_linked_musl_libc_cpython

tests/integration/test_issue_2017.py:40–62  ·  view source on GitHub ↗
(shared_integration_test_tmpdir)

Source from the content-addressed store, hash-verified

38
39@pytest.fixture
40def statically_linked_musl_libc_cpython(shared_integration_test_tmpdir):
41 # type: (str) -> str
42 pbs_distribution_url = (
43 "https://github.com/astral-sh/python-build-standalone/releases/download/20221220/"
44 "cpython-3.10.9+20221220-x86_64_v3-unknown-linux-musl-install_only.tar.gz"
45 )
46 tarball_name = os.path.basename(urlparse.urlparse(pbs_distribution_url).path)
47 pbs_distribution = os.path.join(shared_integration_test_tmpdir, "PBS-dists", tarball_name)
48 with atomic_directory(pbs_distribution) as chroot:
49 if not chroot.is_finalized():
50 tarball_dest = os.path.join(chroot.work_dir, tarball_name)
51 with URLFetcher().get_body_stream(pbs_distribution_url) as read_fp, open(
52 tarball_dest, "wb"
53 ) as write_fp:
54 shutil.copyfileobj(read_fp, write_fp)
55 with tarfile.open(tarball_dest) as tf:
56 tf.extractall(chroot.work_dir)
57 statically_linked_musl_libc_cpython = os.path.join(
58 chroot.work_dir, "python", "bin", "python3"
59 )
60 assert is_exe(statically_linked_musl_libc_cpython)
61
62 return os.path.join(pbs_distribution, "python", "bin", "python3")
63
64
65@pytest.mark.skipif(

Callers

nothing calls this directly

Calls 8

atomic_directoryFunction · 0.90
URLFetcherClass · 0.90
is_exeFunction · 0.90
is_finalizedMethod · 0.80
get_body_streamMethod · 0.80
openMethod · 0.80
extractallMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected