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
I stumbled upon this when tweaking my pyproject.toml where the python version is 3.10 and my project.requires-python is 3.11. I didn't catch this at first in the documentation. Specifically:
The resolvers will be based on the [python-sources option](https://hatch.pypa.io/latest/plugins/environment/virtual/#options) and all resolved interpreters will ensure compatibility with the project's defined [Python support](https://hatch.pypa.io/latest/config/metadata/#python-support).
When creating the environment with this kind of setup for the first time, a user will get the following error:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='None'. Which comes from virtualenv.
For the uninitiated the error message is not very informative. I traced back how Hatch passes in python_spec and looks like Hatch is aware when env.python < project.requires-python by explicitly passing in None. So, it should be possible for Hatch to exit early without having to call virtualenv and output a more tailored error message for this situation
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I stumbled upon this when tweaking my
pyproject.toml
where thepython
version is3.10
and myproject.requires-python
is3.11
. I didn't catch this at first in the documentation. Specifically:The resolvers will be based on the [python-sources option](https://hatch.pypa.io/latest/plugins/environment/virtual/#options) and all resolved interpreters will ensure compatibility with the project's defined [Python support](https://hatch.pypa.io/latest/config/metadata/#python-support).
When creating the environment with this kind of setup for the first time, a user will get the following error:
RuntimeError: failed to find interpreter for Builtin discover of python_spec='None'
. Which comes fromvirtualenv
.For the uninitiated the error message is not very informative. I traced back how Hatch passes in
python_spec
and looks like Hatch is aware whenenv.python < project.requires-python
by explicitly passing inNone
. So, it should be possible for Hatch to exit early without having to callvirtualenv
and output a more tailored error message for this situationBeta Was this translation helpful? Give feedback.
All reactions