-
-
Notifications
You must be signed in to change notification settings - Fork 261
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
Respect Requires-Python
in PEXEnvironment
.
#923
Conversation
A test was added that failed previously as outlined in #898. Beyond that, concretely, for:
OLDWe used to see the following Pex metadata:
And the following suprious errors:
NEWWe now see the following Pex metadata:
The Python 2.7 case above now works and the python 3.5 case above does as well as shown here:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, I just had a question that occurred to me while reviewing.
# used to build this pex already did so. There may be multiple distributions satisfying any | ||
# particular key (e.g.: a Python 2 specific version and a Python 3 specific version for a | ||
# multi-python PEX) and we want the working set to pick the most appropriate one. | ||
req = Requirement.parse(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requirement.parse() chokes on requirements that aren't of the form foo==x.y.z, e.g., URLs. So this cannot support URLs. And I know that is not a consequence of this change, it was true before, since the method that calls this one also calls Requirement.parse(), and WorkingSet.resolve() takes parsed Requirement objects.
So this comment is actually a question for my own education - do URL requirements work today? If so, how? Is this a build time/run time distinction? I have a feeling I have used them successfully since the switch to using pip.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a build time / run time distinction.
These are requirements stored in a built PEX's metadata, and all of those requirements are of the form [key]==[version](; [markers])
. They are this way since they're buit from the results of a resolve. That resolve does accept the myriad forms of requirement strings, but it plops out concrete dists. Those concrete dists are used to create the requirements in the PEX metadata used here to boot up at PEX runtime:
https://github.com/pantsbuild/pex/blob/a07954a1bce1cf0c023c67f36e4e37f078eb23ba/pex/resolver.py#L555-L579
Which uses:
https://github.com/pantsbuild/pex/blob/a07954a1bce1cf0c023c67f36e4e37f078eb23ba/pex/resolver.py#L96-L97
CI is getting hit by tox-dev/tox#1538 - I'll need to pin our tox version - I think - to fix. |
Previously Pex did not properly handle activation of wheels with `Requires-Python` metadata restricting the wheel use to certain Python interpreter versions. Fixes pex-tool#898
Re-based against tox/venv fix in #924. |
Previously Pex did not properly handle activation of wheels with
Requires-Python
metadata restricting the wheel use to certain Pythoninterpreter versions.
Fixes #898