-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Added support for [tool.uv.preview-features] in TOML configs (#15767) #16452
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
base: main
Are you sure you want to change the base?
Added support for [tool.uv.preview-features] in TOML configs (#15767) #16452
Conversation
|
Some docker CI jobs failing, all due to I've checked other recent PRs and I'm seeing similar failures (example), so I suspect this is a transient issue not related to my changes. |
|
This being my first PR in |
|
Cool thanks! Some quick high-level thoughts (I haven't looked at the code yet)
I think we should actually combine them. If we get feedback that people need to be able to disable specific features, then the canonical way to do so in uv's interface would be to add a Don't worry about those Depot authentication failures — we're working with them to resolve those. |
Got it, thanks for explaining. That should be an easy fix, I’ll get to that later today. |
|
@zanieb I want to clarify one thing before submitting my revision. Suppose we pass preview = false
preview-features = ["format"]
I would intuitively expect that
|
Preview features are specified as a list of strings in TOML, which parse to PreviewFeatures values. CLI arguments like --preview and --no-preview take precedence over config values. --preview-features combines with config values.
b920a3e to
f4d3d7d
Compare
|
I pushed what made intuitive sense to me:
Happy to change this if requested! |
Relates to (#15767)
Summary
Before this PR, specific preview features could only be specified via a comma-separated list in CLI
--preview-features. Now, preview features can be specified as a list of strings inpyproject.tomloruv.toml. For example,--previewand--no-previewtake precedence overtool.uv.preview, which matches the previous semantics.--preview-featureswill generally combine withtool.uv.preview-featureswith a couple of nuances:tool.uv.preview = false, only--preview-featureswill be used. This allows the CLI to have precedence over the config.tool.uv.preview = true, all features will be enabled (technically,--preview-featuresare combined with all features).Alternatives Considered
From #15767 (comment):
I chose not to take this approach because it adds complexity and the semantics don't align with
uvtoday. For example,--no-previewwill currently take priority, even ifpyproject.tomlhasuv.tool.preview = true. I think drivinguvfrom the top-down like this is generally the right decision (and changing the semantics for a small feature like this would certainly not be).Test Plan
cargo nextest runcargo buildIn addition to the above, I also tried a small test project:
pyproject.tomltestFrom the
uv/project root: