Skip to content
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

fix: prefer python3 over python when discovering the interpreter #1821

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Nov 24, 2024

  1. fix: prefer python3 over python when discovering the interpreter

    Previously hatch used `python` as the default name of the interpreter.
    This was not in line with PEP-394 [1], since `python` is still allowed
    to point to a Python 2.x interpreter.
    PEP-394 recommends to use `python3` in a system context and `python` 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 via `python` (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 pypa#583
    
    See pypa#1820
    
    [1] https://peps.python.org/pep-0394/
    sumpfralle committed Nov 24, 2024
    Configuration menu
    Copy the full SHA
    91088b5 View commit details
    Browse the repository at this point in the history