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

Make uv venv use the python version listed in .python-version if no --python is provided #1850

Closed
jfcherng opened this issue Feb 22, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request

Comments

@jfcherng
Copy link
Contributor

jfcherng commented Feb 22, 2024

As the title. People can list multiple versions in the .python-version file too. The first matched one should be used.

E.g., with the following .python-version, 3.12 is preferred but 3.11 is fine as well.

3.12
3.11

It looks like uv project uses .python-versions (there is a trailing s somehow). pyenv uses .python-version.

@zanieb
Copy link
Member

zanieb commented Feb 22, 2024

HI! That file is for internal development purposes – we need multiple specific Python versions to test this project.

We don't support .python-version markers at all. We definitely can consider it though.

@zanieb zanieb added the enhancement New feature or request label Feb 22, 2024
@liiight
Copy link

liiight commented Mar 4, 2024

+1 for this.
I have a use case where different branches are currently using different python version as part of a transition so using a versioned file to specify this would be great.

Thank you for this wonderful project!

@Spenhouet
Copy link

Spenhouet commented Apr 20, 2024

This becomes especially interesting in combination with #2607

@konstin
Copy link
Member

konstin commented Jul 1, 2024

Implemented in #4335

@konstin konstin closed this as completed Jul 1, 2024
@jfcherng
Copy link
Contributor Author

jfcherng commented Jul 1, 2024

Just leave a note here the command is: uv venv --preview

Update: now --preview is not needed as of v0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants