# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
strategy:
matrix:
os-type: [ubuntu, macos, windows]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t", "3.15", "3.15t"]
exclude:
- os-type: macos
python-version: "3.14t"
- os-type: macos
python-version: "3.15t"
include:
- build-docs: true # We ensure documentation builds, except on very old interpreters.
- python-version: "3.8"
build-docs: false
- experimental: false
- python-version: "3.15"
experimental: true
- python-version: "3.15t"
experimental: true
fail-fast: false
runs-on: ${{ matrix.os-type }}-latest
defaults:
run:
shell: bash --noprofile --norc -exo pipefail {0}
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.experimental }}
- name: Set up WSL (Windows)
if: matrix.os-type == 'windows'
uses: Vampire/setup-wsl@v7.0.0
with:
wsl-version: 1
- name: Prepare this repo for tests
run: |
./init-tests-after-clone.sh
- name: Set git user identity and command aliases for the tests
run: |
git config --global user.email "travis@ci.com"
git config --global user.name "Travis Runner"
# If we rewrite the user's config by accident, we will mess it up
# and cause subsequent tests to fail
cat test/fixtures/.gitconfig >> ~/.gitconfig
- name: Update PyPA packages
run: |
python -m pip install -U pip 'setuptools; python_version