-
-
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
Plumb Pip's --{no,only}-binary
.
#2346
Changes from all commits
111cfae
3257bbb
e924df4
c00afb7
6aa4ea4
a1f0aad
992c544
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ | |
from pex.resolve.lockfile.model import Lockfile | ||
from pex.resolve.lockfile.subset import subset | ||
from pex.resolve.requirement_configuration import RequirementConfiguration | ||
from pex.resolve.resolver_configuration import ResolverVersion | ||
from pex.resolve.resolver_configuration import BuildConfiguration, ResolverVersion | ||
from pex.resolve.resolvers import MAX_PARALLEL_DOWNLOADS, Resolver, ResolveResult | ||
from pex.resolver import BuildAndInstallRequest, BuildRequest, InstallRequest | ||
from pex.result import Error, catch, try_ | ||
|
@@ -44,7 +44,11 @@ | |
if TYPE_CHECKING: | ||
from typing import Dict, Iterable, Mapping, Optional, Sequence, Tuple, Union | ||
|
||
import attr # vendor:skip | ||
|
||
from pex.hashing import HintedDigest | ||
else: | ||
from pex.third_party import attr | ||
|
||
|
||
class FileArtifactDownloadManager(DownloadManager[FileArtifact]): | ||
|
@@ -81,8 +85,7 @@ def __init__( | |
network_configuration=None, # type: Optional[NetworkConfiguration] | ||
password_entries=(), # type: Iterable[PasswordEntry] | ||
cache=None, # type: Optional[str] | ||
use_pep517=None, # type: Optional[bool] | ||
build_isolation=True, # type: bool | ||
build_configuration=BuildConfiguration(), # type: BuildConfiguration | ||
pex_root=None, # type: Optional[str] | ||
pip_version=None, # type: Optional[PipVersionValue] | ||
resolver=None, # type: Optional[Resolver] | ||
|
@@ -98,8 +101,9 @@ def __init__( | |
self._network_configuration = network_configuration | ||
self._password_entries = password_entries | ||
self._cache = cache | ||
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 commentThe reason will be displayed to describe this comment to others. Learn more. This is a bug. The incoming See #2389 for the fallout. |
||
) | ||
self._pip_version = pip_version | ||
self._resolver = resolver | ||
self._use_pip_config = use_pip_config | ||
|
@@ -123,10 +127,7 @@ def save( | |
resolver_version=self._resolver_version, | ||
network_configuration=self._network_configuration, | ||
password_entries=self._password_entries, | ||
use_wheel=False, | ||
prefer_older_binary=False, | ||
use_pep517=self._use_pep517, | ||
build_isolation=self._build_isolation, | ||
build_configuration=self._build_configuration, | ||
max_parallel_jobs=1, | ||
pip_version=self._pip_version, | ||
resolver=self._resolver, | ||
|
@@ -237,11 +238,7 @@ def resolve_from_lock( | |
resolver_version=None, # type: Optional[ResolverVersion.Value] | ||
network_configuration=None, # type: Optional[NetworkConfiguration] | ||
password_entries=(), # type: Iterable[PasswordEntry] | ||
build=True, # type: bool | ||
use_wheel=True, # type: bool | ||
prefer_older_binary=False, # type: bool | ||
use_pep517=None, # type: Optional[bool] | ||
build_isolation=True, # type: bool | ||
build_configuration=BuildConfiguration(), # type: BuildConfiguration | ||
compile=False, # type: bool | ||
transitive=True, # type: bool | ||
verify_wheels=True, # type: bool | ||
|
@@ -262,9 +259,7 @@ def resolve_from_lock( | |
constraint_files=constraint_files, | ||
), | ||
network_configuration=network_configuration, | ||
build=build, | ||
use_wheel=use_wheel, | ||
prefer_older_binary=prefer_older_binary, | ||
build_configuration=build_configuration, | ||
transitive=transitive, | ||
) | ||
) | ||
|
@@ -311,8 +306,7 @@ def resolve_from_lock( | |
resolver_version=resolver_version, | ||
network_configuration=network_configuration, | ||
password_entries=password_entries, | ||
use_pep517=use_pep517, | ||
build_isolation=build_isolation, | ||
build_configuration=build_configuration, | ||
pip_version=pip_version, | ||
resolver=resolver, | ||
use_pip_config=use_pip_config, | ||
|
@@ -435,9 +429,7 @@ def resolve_from_lock( | |
use_pip_config=use_pip_config, | ||
), | ||
compile=compile, | ||
prefer_older_binary=prefer_older_binary, | ||
use_pep517=use_pep517, | ||
build_isolation=build_isolation, | ||
build_configuration=build_configuration, | ||
verify_wheels=verify_wheels, | ||
pip_version=pip_version, | ||
resolver=resolver, | ||
|
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:
then again, I would expect that
--force-pep517
is the same as--use-pep517
(based on my understanding of howArgumentParser
works), but the help has so many layers that I get the impression that they are not.. (also, that it readsdefault: None
rather thandefault: 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:
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.