Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

pre-commit.ci status

deadsnakes/action

a GitHub action to install (pre-release) pythons from deadsnakes

using this action

To use this action, add it adjacent to setup-python and opt into it conditionally. Here's an example which uses python-version as a matrix.

on:
  push:

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        python-version: [3.6, 3.7, 3.8, 3.9-dev, 3.10-dev]
    name: main
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-python@v2
        if: "!endsWith(matrix.python-version, '-dev')"
        with:
          python-version: ${{ matrix.python-version }}
      - uses: deadsnakes/[email protected]
        if: endsWith(matrix.python-version, '-dev')
        with:
          python-version: ${{ matrix.python-version }}
          # debug: true  # Optional, to select a Python debug build
          # nogil: true  # Optional, to select a free-threaded Python build (3.13+ only)
      - run: python --version --version && which python

available versions

In either case, the actions's debug input can be used to install a debug build of the selected Python version, by adding debug: true.

The nogil input can be used instead of debug to install an experimental free-threaded build of the selected Python version, by adding nogil: true Only available for Python 3.13 and later.