-
Notifications
You must be signed in to change notification settings - Fork 892
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
venv and pip-compile subcommands should respect requires-python
#832
Comments
I just ran into this - to give a concrete example, if I have a
and run:
it will try and build an ancient version of Numpy that isn't Python 3-compatible:
|
This would also be very useful to me – was trying to get someone unfamiliar with Python up and running using uv (because it makes everything so easy!) and couldn't just tell them to do The toolchains on the horizon will no doubt make this sort of thing a lot easier but even so, it would be nice if the user is prevented from creating a venv with a Python version that doesn't meet the minimum requirements of the project. |
It seems that |
If you have a Python requirement, I think you should be providing that with |
Well, |
I guess it makes sense to make that distinction. At the same time, I can't think when you would actively want to use a different Python version for a tool as for your project? (Barring the tool not being available for that version, in which case you're surely unlikely to be using it.) Meanwhile I can think of a couple of situations where it might cause an issue by not being synced:
But is it really global? If I create a venv using |
This is probably not intentional. We're just following our standard interpreter discovery order. Arguably that's weird behavior but anyway yeah it seems nice to find an interpreter relevant to where you're working.
|
|
Running
puffin venv
in a directory with a pyproject.toml in it (or in any parent) with e.g.should default to the highest available python matching the specifiers.
Currently, when
python
is 3.10, it will create an incompatible venv with python 3.10 instead.The same goes for the
pip-compile
withpyproject.toml
. Currently, it will resolve for versions mismatchingrequires-python
. It should also try to find a matchingpython3.x
when no python version is activated by iterating over matching supportedpython3.x
until it finds one inPATH
.The
venv
subcommand should also get a--resolution lowest
option to force the lowest compatible python version instead. This is useful to ensure compatibility in CI.The text was updated successfully, but these errors were encountered: