Skip to content

Add env UV_SYSTEM_PYTHON as alias to --system#2354

Merged
charliermarsh merged 3 commits intoastral-sh:mainfrom
edenhaus:system-env
Mar 11, 2024
Merged

Add env UV_SYSTEM_PYTHON as alias to --system#2354
charliermarsh merged 3 commits intoastral-sh:mainfrom
edenhaus:system-env

Conversation

@edenhaus
Copy link
Copy Markdown
Contributor

@edenhaus edenhaus commented Mar 11, 2024

Summary

Add a new env variable UV_SYSTEM as alias for the cli argument
--system.
Use cases:

  • No need to specify on each uv call inside the docker container the
    --system flag
  • It allows installing and configuring uv in a base container and in the
    child containers nobody needs to know if you need the --system cli
    flag
  • The Home Assistant development env can be set up via devcontainer or a
    venv. Both use some common scripts. Instead of adding duplicate or
    special code to identify the dev container to set the --system flag,
    it would be nicer to set it via an env variable.

I'm unfamiliar with Rust and tried to add the support by looking at the
code.

Test Plan

I did test it manually
UV_SYSTEM_PYTHON=true uv pip install requests

@charliermarsh charliermarsh self-requested a review March 11, 2024 14:21
@charliermarsh charliermarsh self-assigned this Mar 11, 2024
@charliermarsh charliermarsh added the configuration Settings and such label Mar 11, 2024
@edenhaus edenhaus marked this pull request as ready for review March 11, 2024 14:46
Copy link
Copy Markdown
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks! I changed it to UV_SYSTEM_PYTHON, since UV_SYSTEM felt a little too generic. I know it deviates from the CLI but I think it's worth it.

@charliermarsh charliermarsh enabled auto-merge (squash) March 11, 2024 20:52
@charliermarsh charliermarsh merged commit 85483e8 into astral-sh:main Mar 11, 2024
@konstin konstin changed the title Add env UV_SYSTEM as alias to --system Add env UV_SYSTEM_PYTHON as alias to --system Mar 11, 2024
@edenhaus edenhaus deleted the system-env branch March 12, 2024 08:08
konstin pushed a commit that referenced this pull request Mar 12, 2024
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
Fix left over after renaming UV_SYSTEM to UV_SYSTEM_PYTHON in
#2354
CC @charliermarsh 

## Test Plan

<!-- How was it tested? -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

configuration Settings and such

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants