Skip to content
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

Add [python].enable_resolves and [python].experimental_default_resolve #13967

Merged
merged 1 commit into from
Dec 23, 2021

Conversation

Eric-Arellano
Copy link
Contributor

@Eric-Arellano Eric-Arellano commented Dec 22, 2021

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 of default.

Everyone agreed in Slack that we should use python instead of py, e.g. 3rdparty/python over 3rdparty/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 called default.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 normal requirements.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]

…olve`

# 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]
Copy link
Member

@stuhood stuhood left a comment

Choose a reason for hiding this comment

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

Thanks!

),
)
register(
"--enable-resolves",
Copy link
Member

Choose a reason for hiding this comment

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

Would it be ambiguous to call this "require-lockfile" or something? It's not quite clear what "enabling resolves" would mean, and most users will only be enabling lockfiles, rather than enabling multiple resolves.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it'd be a little confusing because we've in the past called "constraints" a "lockfile", so it's an overloaded term. And we have --experimental-lockfile which we know a few users are using.

I went with --enable-resolves because the overall new feature can be called "resolves" to differentiate from the status quo. Even if you only have a single resolve, you still have fields like compatible_resolves, resolve, and --default-resolve. "resolve" is the main way we refer to this feature.

@Eric-Arellano Eric-Arellano merged commit 3274c0e into pantsbuild:main Dec 23, 2021
@Eric-Arellano Eric-Arellano deleted the default-resolve branch December 23, 2021 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lockfiles: figure out how to model the default resolve for multiple user resolves
2 participants