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

Use BoolishValueParser for boolean environment variables #3113

Merged
merged 1 commit into from
Apr 18, 2024

Conversation

charliermarsh
Copy link
Member

Summary

Right now, we only accept _exactly UV_NATIVE_TLS=true and UV_NATIVE_TLS=false. BoolishValueParser accepts a wider range of values:

/// True values are `y`, `yes`, `t`, `true`, `on`, and `1`.
pub(crate) const TRUE_LITERALS: [&str; 6] = ["y", "yes", "t", "true", "on", "1"];

/// False values are `n`, `no`, `f`, `false`, `off`, and `0`.
pub(crate) const FALSE_LITERALS: [&str; 6] = ["n", "no", "f", "false", "off", "0"];

I tend to use 0 and 1 personally so this surprised me.

@charliermarsh charliermarsh marked this pull request as ready for review April 18, 2024 03:48
@charliermarsh charliermarsh added the cli Related to the command line interface label Apr 18, 2024
@charliermarsh charliermarsh force-pushed the charlie/bool branch 2 times, most recently from 992a36a to 74c1310 Compare April 18, 2024 03:57
@charliermarsh charliermarsh merged commit 37aefbd into main Apr 18, 2024
37 of 38 checks passed
@charliermarsh charliermarsh deleted the charlie/bool branch April 18, 2024 04:37
charliermarsh pushed a commit that referenced this pull request Apr 19, 2024
## Summary

Following up 

- #3113
- #3115

It looks like `uv pip compile` command with `UV_SYSTEM_PYTHON` is missed
because these two PRs are close in time. And thus resulting in


```bash
$ uv --version
uv 0.1.34 (9259ece 2024-04-19)
$ UV_SYSTEM_PYTHON=1 uv pip compile --upgrade requirements.in -o requirements.txt
error: invalid value '1' for '--system'
  [possible values: true, false]

For more information, try '--help'.
```

Signed-off-by: Jack Cherng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants