fix: prefer python3
over python
when discovering the interpreter
#1821
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously hatch used
python
as the default name of the interpreter. This was not in line with PEP-394 [1], sincepython
is still allowed to point to a Python 2.x interpreter.PEP-394 recommends to use
python3
in a system context andpython
in the context of a virtual environment.This change should not affect existing setups, since
python3
is expected to exist under all circumstances (according to PEP-394).The change will relieve users from the burden of adding
python = /usr/bin/python3
to their environment configuration for hatch in order to support setups, where a Python 2.x interpreter is reachable viapython
(as specified in PEP-394).The other occurrences of
python
within hatch's code seem to be used within virtual environments (i.e.python
is suitable here).See #583
See #1820
[1] https://peps.python.org/pep-0394/