-
-
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
Support PEX files as resolve repositories. #1108
Comments
A few notes on the resolve logic implementation:
Taking Pip as being too large to vendor in the PEX runtime If we did leverage Pip instead to do resolves / convert |
The concern is bundle size, right? Vendoring pip at build time removed a lot of complexity from Pex, and I suspect that vendoring here would avoid adding lots of complexity/edge cases to runtime. |
Right. For example the Pex PEX itself would go from 2,683,442 bytes to 4,126,954 bytes.
That is definitely not the case:
Vs:
What it did do though is make PEX resolution identical to the resolution people expected since Pip was and surely still is the dominant resolver / de-facto standard.
This could be true. Keep in mind, all the difficulty of a real resolve is completed by Pip and hidden behind the distributions inside the |
The motivation is improvements to tag handling across the board and opening the door for treating PEXes as repositories to resolve from. Work towards #1108.
@jsirois : My primary question to help decide between these is: "how quickly can pip resolve from a directory/collection of wheels like this?": if it's pretty quick (maybe, within 2x of a custom solution), then it seems like that would be the way to go, because there is potentially more logic involved in the "graph walk" than just literal lookups in a hashmap, and duplicating that logic in PEX to avoid talking to pip would probably be worth avoiding unless the performance difference is significant. |
@stuhood your conclusion sounds exactly equal to mine above. To do a time comparison the cheapest way is to implement the custom logic 1st since the pip side of the timing can just be emulated via a pip download command. To do the inverse is a much bigger change since getting pip to resolve from a PEX file requires converting PEX files to contain wheels (today they contain pre-installed wheels), and then installing them at runtime. |
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.
This is needed to support pex-tool#1020 and pex-tool#1108.
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.
We need this in order to support resolving foreign platforms from PEX file repositories just like we support resolving foreign platforms from traditional index servers and find links repositories via Pip. We use `pip debug` for this even though Pip warns against relying on the output of that command. Since Pip is vendored, this is only a concern when we upgade our vendored Pip. If Pip does yank the debug output we need or alter its format, we can either implement our own logic using packaging.tags (~150 LOC) or adapt our parsing logic respectively. Work towards pex-tool#1108.
We need this in order to support resolving foreign platforms from PEX file repositories just like we support resolving foreign platforms from traditional index servers and find links repositories via Pip. We use `pip debug` for this even though Pip warns against relying on the output of that command. Since Pip is vendored, this is only a concern when we upgade our vendored Pip. If Pip does yank the debug output we need or alter its format, we can either implement our own logic using packaging.tags (~150 LOC) or adapt our parsing logic respectively. Work towards pex-tool#1108.
We need this in order to support resolving foreign platforms from PEX file repositories just like we support resolving foreign platforms from traditional index servers and find links repositories via Pip. We use `pip debug` for this even though Pip warns against relying on the output of that command. Since Pip is vendored, this is only a concern when we upgade our vendored Pip. If Pip does yank the debug output we need or alter its format, we can either implement our own logic using packaging.tags (~150 LOC) or adapt our parsing logic respectively. Work towards #1108.
Instead of requiring a PythonIntepreter to resolve distributions in a PEXEnvironment, a DistributionTarget is enough. This allows for resolving distributions from a PEXEnvironment given only a Platform which we need to support resolving from a `--pex-repository` in pex-tool#1108.
Instead of requiring a PythonIntepreter to resolve distributions in a PEXEnvironment, a DistributionTarget is enough. This allows for resolving distributions from a PEXEnvironment given only a Platform which we need to support resolving from a `--pex-repository` in pex-tool#1108.
Instead of requiring a PythonIntepreter to resolve distributions in a PEXEnvironment, a DistributionTarget is enough. This allows for resolving distributions from a PEXEnvironment given only a Platform which we need to support resolving from a `--pex-repository` in pex-tool#1108.
Introduce a `--pex-repository` option to the Pex CLI to switch requirement resolution from using index servers and find-links repositories to using a local PEX file with pre-resolved requirements. This can be useful when a number of projects share a consistent resolve via a shared requirement file. You can resolve the full requirement file into a requirements PEX and then later resolve just the portions needed by each individual project from the fully resolved requirements PEX. Fixes pex-tool#1108
Instead of requiring a PythonIntepreter to resolve distributions in a PEXEnvironment, a DistributionTarget is enough. This allows for resolving distributions from a PEXEnvironment given only a Platform which we need to support resolving from a `--pex-repository` in #1108.
Introduce a `--pex-repository` option to the Pex CLI to switch requirement resolution from using index servers and find-links repositories to using a local PEX file with pre-resolved requirements. This can be useful when a number of projects share a consistent resolve via a shared requirement file. You can resolve the full requirement file into a requirements PEX and then later resolve just the portions needed by each individual project from the fully resolved requirements PEX. Fixes pex-tool#1108
Introduce a `--pex-repository` option to the Pex CLI to switch requirement resolution from using index servers and find-links repositories to using a local PEX file with pre-resolved requirements. This can be useful when a number of projects share a consistent resolve via a shared requirement file. You can resolve the full requirement file into a requirements PEX and then later resolve just the portions needed by each individual project from the fully resolved requirements PEX. Fixes #1108
This would allow using
--pex-repository
instead of--index
/--find-links
to attempt to resolve requirements from an already built PEX. This feature would support a Pants use case in pantsbuild/pants#11105 and the underlying implementation is also needed to support #1020 correctly. In that case, each interpreter found on a given host could be tried for compatibility with a PEX by attempting to resolve all its requirements from itself using that interpreter.The text was updated successfully, but these errors were encountered: