-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Description
When running uv venv, the user may specify the options --system-site-packages and --relocatable. These values persist in .venv/pyenv.cfg as shown:
home = C:\WinPython\python-3.12.4.amd64
implementation = CPython
uv = 0.2.33
version_info = 3.12.4
include-system-site-packages = true
relocatable = trueThe uv sync command implicitly creates a virtual environment in .venv, which is awesome. However, it is not possible to pass these options to uv sync or set them in the tool.uv section (or a tool.uv.venv section) of pyproject.toml. The virtual environment created with uv sync always defaults to setting include-system-site-package and relocatable to false.
I propose that uv be capable of reading these from pyproject.toml, and also when passed to uv sync.
Maybe a generalized approach to file-based configuration (both uv.toml and pyproject.toml) of uv behavior could be to support a section corresponding to each uv command for all available options:
Example pyproject.toml demonstrating command customization:
[tool.uv]
no-build-isolation = true
dev-dependencies = []
[uv.tool.venv]
relocatable = true
system-site-packages = true
[uv.tool.sync]
relocatable = true
system-site-packages = true
all-extras = true
# Generalization
[uv.tool.command]
option = value