-
-
Notifications
You must be signed in to change notification settings - Fork 286
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
Plumb Pip's --{no,only}-binary
.
#2346
Conversation
Previously, Pex just allowed specifying `--no-wheel` or `--no-build` globally. Now, individual projects can be slated for `--only-wheel` or `--only-build` just as they can with Pip. In the lock case, this information is saved so that lock updates carry the configuration forward. Fixes pex-tool#2343
if build_configuration.use_pep517 is not None: | ||
yield "--use-pep517" if build_configuration.use_pep517 else "--no-use-pep517" |
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.
Q: what makes the pep517 option different from the other bool options?
(realized I could probably reply to myself here by reading pip install --help
)
A: the difference aiui is that pep517 is used by default, so the option really is about disabling it.
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.
Thanks for digging there, but I'm still crying a bit. Did you check out Pex's own docs?:
https://github.com/pantsbuild/pex/blob/015a077d3496205824491bf97136afd719277b12/pex/resolve/resolver_options.py#L206-L224
Assuming those are read, if they still don't make sense, it would be good to know so I can fix.
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.
I fixed that bad URL.
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.
Ah, my bad for not realizing the option was of course documented for pex as well (got tunnel visioned onto the pip
arg..).
Yea, the pex option has a lot of information to digest. Reading it through a few times makes it almost clear. I wonder if there is a typo here:
--- If PEP-517 is forced (--use-pep517 is passed)
+++ If PEP-517 is forced (--force-pep517 is passed)
then again, I would expect that --force-pep517
is the same as --use-pep517
(based on my understanding of how ArgumentParser
works), but the help has so many layers that I get the impression that they are not.. (also, that it reads default: None
rather than default: True
doesn't help which would align with the help text stating that it uses pep517 by default)
So, I feel there's a bit of language ... (failed to find the word I was looking for) here.
I think this option would be clearer using an enum value, but I guess the current state is due to upholding backwards compatibility..? In which case I think making the relationship between --force-pep517
and --use-pep517
clearer would help, and perhaps also mentioning that the default behavior is based on not providing a value for the option (e.g. explain that this flag is a tri-bool)
I can see why you cry a bit over this.
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.
Ok, so to sum up - I think you figured this out, but in case not:
- The option is a None|True|False tri-state
- The default is None
- The option names are all just synonyms (with --no- prefixes negating)
So the default, None, means do the right thing: if there is a pyproject.toml build system, use it; if not use setup.py.
True means use (force) pep 517 always (concoct a setuptools legacy build backend as needed).
False means do not use pep 517.
I have no clue what use cases benefit from the True or False cases, certainly the False case makes no sense I can see. I just exposed this Pip knob to not get between users and Pip. Perhaps my sin was in trying to make the Pip help different / more clear in up in Pex. I clearly failed there!
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.
Thanks. Yea, that summation aligns with my current understanding.
Co-authored-by: Andreas Stenius <[email protected]>
Ok, @cburroughs I knocked this out and will release 2.1.161 as soon as it lands green here in the hour. My time got cut short this stint and I only have through Saturday evening to bang out #2344. I think I'll get that done, but in case not, this should unblock your Pants work on the sharper knife path if you don't want to potentially wait until ~February 9th when I next pick back up work after going AFK this Sunday. |
Thank for the update, context, and enjoy your trip! I'll try to give it a look right now. It lookslike the pex has an extra validation that stops the pip special
|
Sorry about that! It looks like I edited your comment instead of replying. Very bad.
Correct! That's what the pre-existing For context, the |
self._use_pep517 = use_pep517 | ||
self._build_isolation = build_isolation | ||
self._build_configuration = attr.evolve( | ||
build_configuration, allow_wheels=False, prefer_older_binary=False |
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.
This is a bug. The incoming BuildConfiguration
from the user may say allow_builds=False, allow_wheels=True
(the known useful example being a user constraining a --style universal
lock to just wheels), in which case just flipping allow_wheels=False
here leads immediately to BuildConfiguration
failing a pre-condition check (allow_wheels=False, allow_builds=False
makes no sense and is illegal). The VCSArtifactDownloadManager
should complete its thought and say it uses the user BuildConfiguration
but trumps allow_wheels=False, allow_builds=True
since the VCSArtifactDownloadManager
must be able to build a wheel from the VCS checkout to do anything useful at all.
See #2389 for the fallout.
Since pex-tool#2346 which was released in Pex 2.1.161, using `--only-binary X` with a `--lock` would fail fast even if the lock itself was created with `--only-binary X`, which should be compatible. Fixes pex-tool#2432
Previously, Pex just allowed specifying
--no-wheel
or--no-build
globally. Now, individual projects can be slated for
--only-wheel
or--only-build
just as they can with Pip. In the lock case, thisinformation is saved so that lock updates carry the configuration
forward.
Fixes #2343