O que é um arquivo .python-version?
um arquivo .python-version explicado, incluindo o que faz e por que importa em CI/CD.
Um arquivo .python-version declara a versão do Python que um projeto usa, lida pelo pyenv.
O que é
Ele garante a mesma versão do interpretador localmente e no CI, evitando diferenças sutis de comportamento entre releases do Python.
Por que importa em CI/CD
No CI, o actions/setup-python consegue lê-lo via python-version-file, para que o runner instale o interpretador correspondente.
Principais conclusões
- .python-version fixa a versão do Python.
- O pyenv e o setup-python o leem.
- Mantém as versões do interpretador consistentes.
Guias relacionados
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…