Update docs on how to use UV_PROJECT_ENVIRONMENT to use the system python environment (#10817)

## Summary

The docs did mention that you could set the `UV_PROJECT_ENVIRONMENT`
variable to point Uv to use the system Python environment (e.g. for use
in CI or Docker), but it did not document _how_.

Reference:
https://github.com/astral-sh/uv/pull/6834#issuecomment-2319253359

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
Niklas Rosenstein 2025-01-21 19:40:01 +01:00 committed by GitHub
parent 399086d28f
commit 5ecfc3d900
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -172,6 +172,16 @@ This option can be used to write to the system Python environment, though it is
`uv sync` will remove extraneous packages from the environment by default and, as such, may leave
the system in a broken state.
To target the system environment, set `UV_PROJECT_ENVIRONMENT` to the prefix of the Python
installation. For example, on Debian-based systems, this is usually `/usr/local`:
```console
$ python -c "import sysconfig; print(sysconfig.get_config_var('prefix'))"
/usr/local
```
To target this environment, you'd export `UV_PROJECT_ENVIRONMENT=/usr/local`.
!!! important
If an absolute path is provided and the setting is used across multiple projects, the