` .python - Version
Quick Links - Alpha Controls & Instrumentation Inc.

.python version

Social media
Contact information
Address

2900 John St.
Unit 4
Markham, ON  L3R 5G3 - Canada

Email

Phone

(905) 477-2133

Fax

(905) 477-4219

.python - Version

  • Python 3.2 (February 2011)
  • Python 3.3 (September 2012)
  • Python 3.4 (March 2014)
  • Python 3.5 (September 2015)
  • Python 3.6 (December 2016)
  • Python 3.7 (June 2018)
  • Python 3.8 (October 2019)
  • Python 3.9 (October 2020)
  • Python 3.10 (October 2021)
  • Python 3.11 (October 2022)
  • In your CI pipeline, you can read the file dynamically:

    - name: Setup Python
      uses: actions/setup-python@v5
      with:
        python-version-file: '.python-version'
    

    This ensures your CI runs the exact same version as developers.

    If you are setting up a new environment, here is a quick reference for the "version" commands in popular Python tools: .python version

    | Tool | Command to Install/Set Version | Config File Created | | :--- | :--- | :--- | | pyenv | pyenv local 3.10.0 | .python-version | | Poetry | poetry env use 3.10 | poetry.lock / pyproject.toml | | Rye | rye pin 3.10 | .python-version | | Conda | conda install python=3.10 | environment.yml |

    Create a file named .python-version at your project's root that pins the Python version for pyenv and compatible tools. Python 3

    Example contents:

    3.11.4
    

    Notes:

    Related search suggestions:

    import random
    import string
    def generate_random_text(length=10):
        """Generates a random string of fixed length."""
        letters = string.ascii_letters + string.digits + string.punctuation
        return ''.join(random.choice(letters) for i in range(length))
    if __name__ == "__main__":
        # Generate and print a random string of length 20
        print(generate_random_text(20))
    

    Your colleague runs Python 3.10, but you have 3.12 installed. Suddenly, their use of datetime.UTC (new in 3.11) works fine on your machine but fails in CI. A .python-version file eliminates this ambiguity. Your colleague runs Python 3.10

    Code formatters (black), linters (ruff), and type checkers (mypy) behave differently across major Python versions. Locking the version ensures reproducible linting results.


    40