You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As per comment in #5258 (comment), uv venv may respect the requires-python config specified in pyproject.toml. This is a very useful feature to sync a python project not only with its dependencies, but also its python interpreter version.
Currently, seems that only uv sync can do this, but uv sync has a few shortcomings that makes it inconvenient to use. For example:
uv sync does not have --seed option: Synced venv does not have pip installed, and even if we manually install pip, the next time uv sync is executed the pip gets removed.
So, I think the feature described in this issue would be the entrypoint for user to tweak their environment with all dependencies (including python itself) specified in pyproject.toml, instead of having to pass the python version through command line or environment variables.
The text was updated successfully, but these errors were encountered:
)
<!--
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? -->
`uv venv` should support adopting python version specified in
`requires-python` from `pyproject.toml`. This allows customization on
the venv setup when syncing from python project.
Closes#5552.
It also serves as a workaround to close#5258.
## Test Plan
<!-- How was it tested? -->
1. Run `uv venv` in folder with `pyroject.toml` specifying
`requries-python = "<3.10"`. Python 3.9 is selected for venv.
2. Change to `requries-python = "<3.11"` and run `uv venv` again. Python
3.10 is selected now.
3. Switch to a folder without `pyproject.toml` then run `uv venv`.
Python 3.12 is selected now.
---------
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
As per comment in #5258 (comment),
uv venv
may respect therequires-python
config specified inpyproject.toml
. This is a very useful feature to sync a python project not only with its dependencies, but also its python interpreter version.Currently, seems that only
uv sync
can do this, butuv sync
has a few shortcomings that makes it inconvenient to use. For example:uv sync
does not have--seed
option: Synced venv does not havepip
installed, and even if we manually install pip, the next timeuv sync
is executed thepip
gets removed.uv sync
cannot have custom venv prompt set.uv sync
command #5258So, I think the feature described in this issue would be the entrypoint for user to tweak their environment with all dependencies (including python itself) specified in
pyproject.toml
, instead of having to pass the python version through command line or environment variables.The text was updated successfully, but these errors were encountered: