Closed FishAlchemist closed 1 week ago
We follow the default Python discovery rules, so we'll use the first version we find either
1) The newest installed managed Python version 2) The first system Python installation on the PATH regardless of version
We follow the default Python discovery rules, so we'll use the first version we find either
- The newest installed managed Python version
- The first system Python installation on the PATH regardless of version
If UV first analyze the requirements to determine the supported Python version range, and then run the default Python discovery rules based on the results, would it be a better way to find the Python version?
However, it seems like Pip can still download packages even if they aren't explicitly categorized for a specific Python version. For instance, MonkeyType's highest categorized version is Python 3.10, but it can be installed in a Python 3.12 environment.
Despite the questions I raised about this find strategy, it seems to have had no practical impact.
The supported Python range of... all possible versions of the requirements? Then we try to find out if you have that installed? I don't think that's really tractable, but we have a bigger problem: we need a Python interpreter for markers to figure out what your platform is — we usually need a Python interpreter before we can start resolution for an installation.
We ignore upper bounds on package's Python requirements, generally.
The supported Python range of... all possible versions of the requirements? Then we try to find out if you have that installed? I don't think that's really tractable, but we have a bigger problem: we need a Python interpreter for markers to figure out what your platform is — we usually need a Python interpreter before we can start resolution for an installation.
We ignore upper bounds on package's Python requirements, generally.
Explicitly specifying --python for this issue might be the best solution. Therefore, should the document mention that uvx uses Python discovery rules? If a specific version is required, --python should be explicitly specified.
I guess I feel like that's implicitly documented? Nearly every command uses Python discovery rules. I can try to add some clarity about that to the documentation though.
Discovery of Python versions: https://docs.astral.sh/uv/concepts/python-versions/#discovery-of-python-versions
How does
uvx
determine which Python version to use when--python
is not explicitly specified? I had a quick look through the document, but I couldn't find anything about it.Note: The document version I'm looking for is the one generated using commit 21408c1f351b159a9b590bcfefcfe645838e33c1