How to Test Python 3.15 Compatibility With GitHub Actions

You can test Python 3.15 compatibility before changing the Python version in production. Add a second test job to your pull request: one job runs your existing suite on Python 3.14, and the other runs it on 3.15. GitHub Actions calls this a matrix. Both jobs check out the same code, and each gets its own result.

Python 3.15.0 became stable on October 9, 2026. The useful question for an upgrade is whether your dependencies install and your application tests pass on the new interpreter. Here’s how to check both. Python 3.15 release announcement.

Run the same tests on Python 3.14 and 3.15

Create .github/workflows/python-compatibility.yml. This example assumes your project uses pytest and that requirements.txt installs both the application and test dependencies, including pytest. If your existing CI uses a lockfile, a development requirements file, or a package installation command, copy that installation step into the workflow. Keeping it consistent makes the two results easier to compare.

name: Python compatibility

on:
  pull_request:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  test:
    name: Tests on Python ${{ matrix.python-version }}
    runs-on: ubuntu-latest

    strategy:
      fail-fast: false
      matrix:
        python-version: ["3.14", "3.15"]

    steps:
      - name: Check out the repository
        uses: actions/checkout@v7

      - name: Set up Python
        uses: actions/setup-python@v7
        with:
          python-version: ${{ matrix.python-version }}

      - name: Show the interpreter version
        run: python --version

      - name: Install dependencies
        run: python -m pip install -r requirements.txt

      - name: Run tests
        run: python -m pytest -q

fail-fast: false lets the other job finish if one version fails. That matters here: a failing 3.15 run tells you more when you can see whether 3.14 passed on the same commit. The Show the interpreter version step records the exact patch version used in each run. GitHub’s guide to testing Python across versions.

Trying the workflow in an empty repository?

You can check the matrix setup using Python’s built-in test runner. Save the following as test_config.py in the repository root:

import json
import unittest


class ConfigTest(unittest.TestCase):
    def test_retries_is_integer(self):
        config = json.loads('{"retries": 3}')
        self.assertEqual(config["retries"], 3)
        self.assertIsInstance(config["retries"], int)

In the workflow above, replace the Install dependencies and Run tests steps with this single step:

      - name: Run the smoke test
        run: python -m unittest discover -v

Open a pull request and expand both jobs. Look for test_retries_is_integer and Ran 1 test in each log. Check the count as well as the green tick: a successful run that discovered zero tests tells you very little. This small example checks the workflow wiring. Use your application’s own tests to make an upgrade decision.

Python 3.14 passes and 3.15 fails. What should you check?

Open the 3.15 job and find the first failing step. It tells you where to spend your time.

  • Set up Python failed: Read the setup action’s message and check which interpreter version and runner it requested. At this point, your application tests haven’t started.
  • Install dependencies failed: Find the first package named in the error. Check its Python version requirements, your pinned version, and whether a compatible wheel exists for your runner. If pip tried to build from source, read the first build error.
  • Tests failed: Start with one failing test and its traceback. Run that same test on both versions. If your dependencies are unpinned, compare the installed package versions as well: changing Python can change which dependency version pip selects.
  • Both versions failed: Compare the first error in each job. A missing test dependency or incorrect file path can break both runs before you learn anything about 3.15 compatibility.

What do two green jobs actually tell you?

Check that both jobs ran the expected tests and review any skips. Two passing jobs give you evidence that the tested paths work on both Python versions on the selected Ubuntu runner. If production uses a different base image, native libraries, or external services, the next useful check is to build that image with Python 3.15 and exercise a representative request in staging.

If the tests pass but you’re unsure which application code they exercised, add a coverage report to the pull request. Here’s how to generate the coverage XML GitHub Actions expects.

About the author

Kiran Sonawane

Kiran Sonawane is a DevOps engineer who works with AWS, Azure, Google Cloud, Terraform, and Kubernetes. His experience includes automating infrastructure, managing CI/CD pipelines, securing cloud environments, and deploying AI applications. At Staging Notes, he writes practical guides that help small teams troubleshoot deployments and manage their cloud infrastructure.