Skip to content

Conversation

@charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Jan 5, 2026

Summary

This gives us more flexibility since we can avoid erroring on "conflicts" when one option is disabled (e.g., UV_FROZEN=0 uv lock --check).

Closes #13385.

Closes #13316.

@charliermarsh charliermarsh added bug Something isn't working configuration Settings and such labels Jan 5, 2026
@charliermarsh charliermarsh marked this pull request as ready for review January 5, 2026 01:07
Base automatically changed from charlie/err-msg to main January 5, 2026 12:40
@konstin
Copy link
Member

konstin commented Jan 5, 2026

This is a lot of churn in uv and moves us to a custom pattern of using clap that requires to manually call a check function. Would it be possible to fix this on the clap side (clap-rs/clap#5591), so we can stay with the regular clap pattern and get the validation at parse time?

@charliermarsh
Copy link
Member Author

I will try here: clap-rs/clap#6211. If it ends up taking a long time, though, I'm gonna advocate for merging this since it's a big improvement.

Honestly... it's an improvement even if clap-rs/clap#6211 merges because we now track the source of these variables so we can report them in error messages. I might still advocate for this, it's so much better to be able to say UV_FROZEN is set than --frozen conflicts with whatever else.

Comment on lines 139 to 143
} else if matches!(parse_boolish_environment_variable(env_var), Ok(Some(true))) {
Flag::Enabled {
source: FlagSource::Env(env_var),
name,
}
Copy link
Member

Choose a reason for hiding this comment

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

I kind of wanted to move all the environment variable parsing into EnvironmentOptions

pub struct EnvironmentOptions {

then do combination with our three sources

uv/crates/uv/src/settings.rs

Lines 3453 to 3455 in 9949f08

args: PipOptions,
filesystem: Option<FilesystemOptions>,
environment: EnvironmentOptions,

Copy link
Member

Choose a reason for hiding this comment

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

I think this would fit into your pull request?

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me see what I can do!

@zanieb
Copy link
Member

zanieb commented Jan 5, 2026

It's a long-term goal (from my perspective) to disambiguate between environment variables and command-line arguments throughout, so I'm in favor of this kind of change.

@charliermarsh
Copy link
Member Author

Per clap-rs/clap#5591 (comment), if this gets solved in Clap, it won't be until Clap v5.

charliermarsh and others added 3 commits January 6, 2026 12:46
The env var annotations are no longer auto-generated by Clap since we
removed the `env =` attribute from the affected flags.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@charliermarsh charliermarsh enabled auto-merge (squash) January 6, 2026 20:39
@charliermarsh charliermarsh merged commit cd55d1c into main Jan 6, 2026
101 checks passed
@charliermarsh charliermarsh deleted the charlie/err-from-env branch January 6, 2026 20:43
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jan 12, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.9.22` → `0.9.24` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>astral-sh/uv (astral-sh/uv)</summary>

### [`v0.9.24`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0924)

[Compare Source](astral-sh/uv@0.9.23...0.9.24)

Released on 2026-01-09.

##### Bug fixes

- Fix handling of `UV_NO_SYNC=1 uv run ...` ([#&#8203;17391](astral-sh/uv#17391))
- Rebuild dynamic distribution when version changes with `--no-cache` ([#&#8203;17387](astral-sh/uv#17387))

##### Documentation

- Add Rust language classifier ([#&#8203;17389](astral-sh/uv#17389))

### [`v0.9.23`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0923)

[Compare Source](astral-sh/uv@0.9.22...0.9.23)

Released on 2026-01-09.

##### Enhancements

- Only write portable paths in `RECORD` files ([#&#8203;17339](astral-sh/uv#17339))
- Support relative paths in `UV_PYTHON_BIN_DIR` and `UV_TOOL_BIN_DIR` ([#&#8203;17367](astral-sh/uv#17367))

##### Preview features

- Enable uploads to S3 via pre-signed URLs ([#&#8203;17349](astral-sh/uv#17349))

##### Configuration

- Allow setting proxy variables via global / user configuration ([#&#8203;16918](astral-sh/uv#16918))
- Manually parse and reconcile Boolean environment variables ([#&#8203;17321](astral-sh/uv#17321))

##### Bug fixes

- Avoid broken build artifacts on build failure ([#&#8203;17276](astral-sh/uv#17276))
- Fix missing dependencies on synthetic root in SBOM export ([#&#8203;17363](astral-sh/uv#17363))
- Recognize `armv8l` as an alias for `armv7l` in platform tag parsing ([#&#8203;17384](astral-sh/uv#17384))
- Fix redaction of a URL in a middleware trace log ([#&#8203;17346](astral-sh/uv#17346))

##### Documentation

- Add `index.md` suggestion to `llms.txt` ([#&#8203;17362](astral-sh/uv#17362))
- Clarify that `uv run` uses inexact syncing by default ([#&#8203;17366](astral-sh/uv#17366))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi43NS4xIiwidXBkYXRlZEluVmVyIjoiNDIuNzUuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working configuration Settings and such

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UV_FROZEN=0 uv lock --check fails UV_OFFLINE and --refresh odd behaviour

4 participants