Add [python].enable_resolves
and [python].experimental_default_resolve
#13967
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #12742.
Similar to #13925, this adds a default of
{"python-default": "3rdparty/python/default_lock.txt"}
. It also lets the user set the default resolve via--experimental-default-resolve
.We don't add
--default-compatible-resolves
, as decided in #13902.Default file name
The resolve must be unambiguous with JVM, hence using
python-default
instead ofdefault
.Everyone agreed in Slack that we should use
python
instead ofpy
, e.g.3rdparty/python
over3rdparty/py
. The clarity is worth it.It's unclear to me if we want the file to be called
default_lock.txt
. In JVM, it's calleddefault.lock
. We could do that here too? I only went with.txt
to make it a bit more clear to users that they can use these lockfiles just like a normalrequirements.txt
- Python has a strong convention for this.Deprecation plan:
--enable-resolves
We want to require using resolves in the future, as we believe it is important for users to have secure and reproducible builds. But we can't switch it on immediately.
At the same time, to make the feature useful, it's really useful for us to be able to set defaults.
To bridge the gap,
--enable-resolves
feature gates everything. When set, we can act how we will in the future, e.g. assuming that a default resolve must always be set. When unset, we use the status quo. In Pants 2.10, we will deprecate not setting this option so that we can make the default in Pants 2.11 be to use resolves.[ci skip-rust]
[ci skip-build-wheels]