-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
Top level environment markers are lost in built PEXes. #899
Comments
Fixing this bug will require parsing requirements. In the switch to pip we ~dropped this and started just passing the requirements through to pip as strings. |
The full requirements file spec: https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format |
@jhermann requirementslib would be good but it has fairly out of control transitive dependencies for what Pex needs - just requirements.txt parsing:
I think rolling our own might be the best of bad choices here. |
I'd ask them if they're willing to spin off a helper library before that. I found other projects with more of a library character, but they were unmaintained – having a current parsing package would be useful for many. |
I stumbled across |
This is a prerequisite for fixing #pex-tool#899, implementing pex-tool#1108 and the API will also be useful to Pants which currently can only handle a subset of requirements, forcing edits of existing requirment files to use alternative requirement forms.
Work towards pex-tool#899, pex-tool#1020 and pex-tool#1108.
This removes our dependency on pkg_resources Environment / WorkingSet in favor of performing our own recursive resolve of runtime distributions to activate using distribution metadata. This fixes an old test bug noticed by Benjy but, more importanty, sets the stage to fix pex-tool#899, pex-tool#1020 and pex-tool#1108 by equipping PEXEnvironment with the ability to resolve the appropriate transitive set of distributions from a root set of requirements instead of the current full set of transitive requirements stored post-resolve in PexInfo.
This removes our dependency on pkg_resources Environment / WorkingSet in favor of performing our own recursive resolve of runtime distributions to activate using distribution metadata. This fixes an old test bug noticed by Benjy but, more importanty, sets the stage to fix #899, #1020 and #1108 by equipping PEXEnvironment with the ability to resolve the appropriate transitive set of distributions from a root set of requirements instead of the current full set of transitive requirements stored post-resolve in PexInfo.
In order to fix pex-tool#899, we need to map local project requirements to built wheels after the fact in order to learn the project name and version and thus the full requirement needed for PexInfo metadata. In order to do this with confidence, break up the ReqInfo type into three seperate types to cover the three main parse cases.
Previously we recorded the post-resolve exact requirements of all resolved distributions. This necessitated a good deal of work to recover environment markers and still left out any top-level environment markers specified in direct requirements / requirement files passed to Pex. Now we record all requirements as we received them, only filling in project name and version for local loose-source requirements in our resolve post-processing. This saves time (~O(500ms) for medium to large PEX builds) and fixes bugs. Fixes pex-tool#899
In order to fix #899, we need to map local project requirements to built wheels after the fact in order to learn the project name and version and thus the full requirement needed for PexInfo metadata. In order to do this with confidence, break up the ReqInfo type into three seperate types to cover the three main parse cases.
Previously we recorded the post-resolve exact requirements of all resolved distributions. This necessitated a good deal of work to recover environment markers and still left out any top-level environment markers specified in direct requirements / requirement files passed to Pex. Now we record all requirements as we received them, only filling in project name and version for local loose-source requirements in our resolve post-processing. This saves time (~O(500ms) for medium to large PEX builds) and fixes bugs. Fixes pex-tool#899
Previously we recorded the post-resolve exact requirements of all resolved distributions. This necessitated a good deal of work to recover environment markers and still left out any top-level environment markers specified in direct requirements / requirement files passed to Pex. Now we record all requirements as we received them, only filling in project name and version for local loose-source requirements in our resolve post-processing. This saves time (~O(500ms) for medium to large PEX builds) and fixes bugs. Fixes pex-tool#899
Previously we recorded the post-resolve exact requirements of all resolved distributions. This necessitated a good deal of work to recover environment markers and still left out any top-level environment markers specified in direct requirements / requirement files passed to Pex. Now we record all requirements as we received them, only filling in project name and version for local loose-source requirements in our resolve post-processing. This saves time (~O(500ms) for medium to large PEX builds) and fixes bugs. Fixes #899
When any requirements passed to the Pex CLI have environment markers, these should be recorded in the resulting PEX / PEX-INFO but currently are not. This can lead to erroneous runtime activation failure:
Similar to #898
The text was updated successfully, but these errors were encountered: