What Is a .python-version file?
a .python-version file explained, including what it does and how it matters in CI/CD.
A .python-version file declares the Python version a project uses, read by pyenv.
What it is
It ensures the same interpreter version locally and in CI, avoiding subtle behavior differences across Python releases.
Why it matters in CI/CD
In CI, actions/setup-python can read it via python-version-file so the runner installs the matching interpreter.
Key takeaways
- .python-version pins the Python version.
- pyenv and setup-python read it.
- Keeps interpreter versions consistent.
Related guides
What Is pyproject.toml?pyproject.toml is the modern Python project config. Learn what it declares for CI.
What Is a GitHub Actions Runner?A runner is the machine that executes a GitHub Actions job. It can be GitHub-hosted, self-hosted, or a manage…
What Is an Interpreter? Running Code Line by LineAn interpreter executes source code directly at runtime instead of compiling it ahead of time. Learn how inte…