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 remoting of V2 Python test runnner not being able to discover the Python interpreter #7844

Conversation

Eric-Arellano
Copy link
Contributor

Problem

Separately from the interpreter PEX uses to run Pytest and to resolve requirements, we must also have an interpreter to run PEX itself. This might be the same interpreter used by Pytest, but need not be, so long as it is Python 2.7 or 3.4+.

Currently, we use sys.executable to determine this interpreter. This works when running locally, but fails when remoting because sys.executable is an absolute path, such as '/Users/eric/DocsLocal/code/projects/pants/build-support/pants_dev_deps.py36.venv/bin/python'.

Solution

Use a generic python bin name.

Result

Local execution still works as expected, including choosing a Python 2 vs. Python 3 interpreter via --python-setup-interpreter-constraints.

While remoting still fails due to other issues, this issue no longer causes an error.

@Eric-Arellano Eric-Arellano changed the title Fix remoting of V2 Python tasks not being able to discover the Python interpreter Fix remoting of V2 Python test runnner not being able to discover the Python interpreter Jun 4, 2019
Copy link
Sponsor Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Eric-Arellano Eric-Arellano merged commit 5f1a553 into pantsbuild:master Jun 4, 2019
@Eric-Arellano Eric-Arellano deleted the remoting-fix-python-bin-not-discoverable branch June 4, 2019 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants