Replies: 2 comments 2 replies
|
I guess I must have missed something in my analysis. I just did a fresh coppy project and saw: When I removed the venv and ran uv manually, uv created a 3.13.5 venv. I then removed the venv again, and had mise create the venv. That time, it was back to the 3.12 and the message above. Conclusion: mise must be passing the python version explicitly to the uv venv created command. :o/ |
|
I didn't realize this, but apparently Mise already solved syncing UV and Mise's python version by exporting https://mise.jdx.dev/lang/python.html#python.uv_venv_auto
But, as indicated, they are getting rid of that feature. I wonder why and what they are assuming the intended replacement will be. |
Uh oh!
There was an error while loading. Please reload this page.
For reference: https://docs.astral.sh/uv/concepts/python-versions/
Experiments
No python's in path other than system installed (mise deactivated):
Activate mise:
Managed install(s):
uv prefers the latest version, install order doesn't matter:
uv project initand then .python-version is present and controls the version:Once the .venv exists, it takes precedence:
If
.python-versionis gone, thenpyproject.tomlversion is used:If pyproject.toml version changes, it takes precedence over an incompatible .venv python:
Downgrading with the .venv already in place won't change the version used:
Removing the
.venvresults in a new 3.13 .venv b/c uv prefers the latest managed install:A more restrictive
pyproject.tomlversion will result in an updated.venv:Specifying
UV_PYTHONis also an option:Recommendations
Given:
uvwithout having to run mise first is desirablemise exec -- python --version, can be ignored.requires-pythoncan be beneficial to avoid integrations taking automatic actions when they aren't desirable (Here's looking at you Cloudflare Pages builder). It also avoids having to specify the 'idomatic" setting inmise.toml(nit).~=3.12.5while libraries might want to be more flexible, e.g.>=3.10.Then:
requires_pythoninpyproject.toml, e.g.~=3.12.5.requires_pythonto setup Python.requires_python.requires-pythonfile or addUV_PYTHON=to mise.toml to help homogenize developer's default environmentsrequires_pythonAll reactions