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

Pants python interpreter selection is too coarse #7508

Closed
jsirois opened this issue Apr 5, 2019 · 2 comments
Closed

Pants python interpreter selection is too coarse #7508

jsirois opened this issue Apr 5, 2019 · 2 comments

Comments

@jsirois
Copy link
Contributor

jsirois commented Apr 5, 2019

Right now you can only restrict interpreters used via interpreter constraints that at most can narrow to a fully specified python implementation (say CPython) and version (sat 3.6.8). You may have more that one interpreter matching that on the PATH and which one to select may be a material difference. Real world cases include when you have two CPythin interpreters, both at the same version, but one built for UCS2 and one for UCS4. You may care which to pick and Pants doesn't allow you to do this today. PEX supports PEX_PYTHON and PEX_PYTHON_PATH to point to specific paths which could solve this problem if you know where the right interpreters are located on all machines. It, along with pants, also supports platform constraints. Unfortunately, the platform constraints aren't currently used to select interpreters correctly, just to resolve wheels correctly(ish): pex-tool/pex#658

Pants should support:

  1. interpreter constraints
  2. limited paths
  3. specific platforms

PEX nominally supports all three with only 3 being buggy today.
Pants only supoorts 1 today.

@jsirois
Copy link
Contributor Author

jsirois commented Apr 5, 2019

Noting that the real world cases for support items 2 and 3 are wider. We've had many users - twitter (hacks with pexrc slipped in under pants which causes its own pain) and foursquare notably, but others as well - complain about the lack of control here. Most of these use cases would have been solved by 1st level support for PEX_PYTHON_PATH for example (corporate controlled environments). Our own CI controlled environment would benefit from PEX_PYTHON or a singleton PEX_PYTHON_PATH as well for the ucs2/4 example.

@Eric-Arellano
Copy link
Contributor

We now have first-level support for PEX_PYTHON_PATH via [python-setup].interpreter_search_paths, which gets converted to --python-path and PEX_PYTHON_PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants