Skip to content

Commit

Permalink
Align --resolve-all-constraints help with the new reality.
Browse files Browse the repository at this point in the history
# Rust tests and lints will be skipped. Delete if not intended.
[ci skip-rust]

# Building wheels and fs_util will be skipped. Delete if not intended.
[ci skip-build-wheels]
  • Loading branch information
jsirois committed Apr 29, 2021
1 parent 8b35c70 commit 7c946da
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/python/pants/python/python_setup.py
Expand Up @@ -112,16 +112,10 @@ def register_options(cls, register):
choices=(*(raco.value for raco in ResolveAllConstraintsOption), True, False),
type=ResolveAllConstraintsOption.parse,
help=(
"If set, and the requirements of the code being operated on are a subset of the "
"constraints file, then the entire constraints file will be used instead of the "
"subset. If unset, or any requirement of the code being operated on is not in the "
"constraints file, each subset will be independently resolved as needed, which is "
"more correct - work is only invalidated if a requirement it actually depends on "
"changes - but also a lot slower, due to the extra resolving. "
"\n\n* `never` will always use proper subsets, regardless of the goal being "
"run.\n* `nondeployables` will use proper subsets for `./pants package`, but "
"otherwise attempt to use a single resolve.\n* `always` will always attempt to use "
"a single resolve."
"If enabled, and the requirements of the code being operated on are a subset of "
"the constraints file, then the entire constraints file will be used instead of "
"the subset. If disabled, or any requirement of the code being operated on is not "
"in the constraints file, each subset will be independently resolved as needed."
"\n\nRequires [python-setup].requirement_constraints to be set."
),
)
Expand Down

1 comment on commit 7c946da

@Eric-Arellano
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks for catching this. This doesn't seem quite right though - the subset will still be used thanks to your change. How about something like this?

If enabled, when resolving requirements, Pants will first resolve your entire constraints file as a single global resolve. Then, if the code uses a subset of your constraints file, Pants will extract the relevant requirements from that global resolve so that only what's actually needed gets used. If disabled, Pants will not use a global resolve and will resolve each subset of your requirements independently.

Usually this option should be enabled because it can result in far fewer resolves.

Requires [python-setup].requirement_constraints to be set.

Please sign in to comment.