Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resolve regressions introduced by the 1.4.8. #580

Merged
merged 2 commits into from
Oct 8, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pex/bin/pex.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ def walk_and_do(fn, src_dir):
with TRACER.timed('Resolving distributions'):
try:
resolveds = resolve_multi(resolvables,
interpreters=interpreters,
interpreters=setup_interpreters,
platforms=options.platforms,
cache=options.cache_dir,
cache_ttl=options.cache_ttl,
Expand Down
2 changes: 1 addition & 1 deletion pex/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def resolve_multi(requirements,
"""

interpreters = interpreters or [PythonInterpreter.get()]
platforms = platforms or [Platform.current()]
platforms = platforms or ['current']

seen = set()
for interpreter in interpreters:
Expand Down
31 changes: 31 additions & 0 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -1076,3 +1076,34 @@ def test_pex_interpreter_interact_custom_setuptools_useable():
env=make_env(PEX_VERBOSE=1),
stdin=test_script)
assert rc == 0, stdout


@pytest.mark.skipif(IS_PYPY,
reason='Our pyenv interpreter setup fails under pypy: '
'https://github.com/pantsbuild/pex/issues/477')
def test_setup_python():
interpreter = ensure_python_interpreter(PY27)
with temporary_dir() as out:
pex = os.path.join(out, 'pex.pex')
results = run_pex_command(['jsonschema==2.6.0',
'--disable-cache',
'--python={}'.format(interpreter),
'-o', pex])
results.assert_success()
subprocess.check_call([pex, '-c', 'import jsonschema'])


@pytest.mark.skipif(IS_PYPY,
reason='Our pyenv interpreter setup fails under pypy: '
'https://github.com/pantsbuild/pex/issues/477')
def test_setup_interpreter_constraint():
interpreter = ensure_python_interpreter(PY27)
with temporary_dir() as out:
pex = os.path.join(out, 'pex.pex')
with environment_as(PATH=os.path.dirname(interpreter)):
results = run_pex_command(['jsonschema==2.6.0',
'--disable-cache',
'--interpreter-constraint=CPython=={}'.format(PY27),
'-o', pex])
results.assert_success()
subprocess.check_call([pex, '-c', 'import jsonschema'])