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

Function test_pex_run_custom_setuptools_useable

tests/test_pex.py:940–959  ·  view source on GitHub ↗
(
    setuptools_requirement,  # type: str
    setuptools_version,  # type: str
)

Source from the content-addressed store, hash-verified

938
939
940def test_pex_run_custom_setuptools_useable(
941 setuptools_requirement, # type: str
942 setuptools_version, # type: str
943):
944 # type: (...) -> None
945 result = resolver.resolve(
946 requirements=[parse_requirement_string(setuptools_requirement)],
947 resolver=ConfiguredResolver.default(),
948 )
949 dists = [resolved_dist.distribution for resolved_dist in result.distributions]
950 with temporary_dir() as temp_dir:
951 pex = write_simple_pex(
952 temp_dir,
953 "import setuptools, sys; sys.exit(0 if '{version}' == setuptools.__version__ else 1)".format(
954 version=setuptools_version
955 ),
956 dists=dists,
957 )
958 rc = PEX(pex.path()).run()
959 assert rc == 0
960
961
962def test_pex_run_conflicting_custom_setuptools_useable(

Callers

nothing calls this directly

Calls 8

parse_requirement_stringFunction · 0.90
temporary_dirFunction · 0.90
write_simple_pexFunction · 0.90
PEXClass · 0.90
resolveMethod · 0.45
defaultMethod · 0.45
runMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected