A GitHub Action to install and configure specific Python, PyPy, or GraalPy versions with optional dependency caching.
setup-python is a GitHub Action that installs and configures specific versions of Python, PyPy, or GraalPy interpreters in CI/CD workflows. It solves the problem of inconsistent Python environments across runners by providing precise version control, architecture selection, and built-in dependency caching. The action ensures reproducible builds and reduces setup time by managing interpreter installation and package manager caches automatically.
Developers and DevOps engineers using GitHub Actions for Python projects who need reliable, version-controlled environments for testing, building, or deploying applications.
Developers choose setup-python because it's the official, maintained solution from GitHub for Python environment management, offering seamless integration with Actions, support for multiple interpreters, and built-in caching without complex configuration. Its reliability and active development make it a trusted standard for Python CI/CD.
Set up your GitHub Actions workflow with a specific version of Python
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports CPython, PyPy, GraalPy, and free-threaded Python, allowing testing across multiple implementations as shown in the README's usage examples.
Built-in caching for pip, pipenv, and poetry reduces build times by reusing cached packages, with configurable cache-dependency-path for flexibility.
Allows semantic versioning, ranges, and version files for exact environment specification, ensuring reproducible builds across different runners.
Works with GitHub-hosted and self-hosted runners, including GitHub Enterprise Server, making it suitable for enterprise and custom setups.
Only functions within GitHub Actions, so it's useless for other CI/CD systems, limiting portability and vendor flexibility.
The README admits cache may not be used if dependency files aren't updated, and it doesn't handle authentication for private repositories, requiring extra work.
Version 6 introduced breaking changes like node24 upgrade, requiring specific runner versions, and future updates could disrupt existing workflows without warning.