Skip to content

Commit

Permalink
Add Python 3.13 to GitHub Actions CI
Browse files Browse the repository at this point in the history
Also reverse the list of Python versions to be newest-first.

Split Mypy and PyType requirements into separate files, as PyType doesn't even
install in the Python 3.13 environment, and does not run with Python 3.12+.
  • Loading branch information
mbrukman committed Nov 5, 2024
1 parent 1082489 commit 0401c76
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
fail-fast: false
matrix:
os: [ 'ubuntu-24.04', 'ubuntu-22.04', 'macos-14', 'macos-13' ]
python: [ '3.8', '3.9', '3.10', '3.11', '3.12' ]
python: [ '3.13', '3.12', '3.11', '3.10', '3.9', '3.8' ]
name: Python ${{ matrix.python }} (${{ matrix.os }})
steps:
- name: Checkout repo
Expand All @@ -52,22 +52,32 @@ jobs:
- name: Run tests
run: make test VERBOSE=1

- name: Install Python deps for typechecking tests
run: python -m pip install -r requirements-test.txt
- name: Install Python deps for Mypy typechecking tests
run: python -m pip install -r requirements-mypy.txt

- name: Check types with Mypy
run: make mypy-test
# Mark this check optional for now, in case it starts out failing.
# We will make it required once we've fixed any existing issues.
continue-on-error: true

- name: Install Python deps for PyType typechecking tests
run: python -m pip install -r requirements-pytype.txt
# https://github.com/google/pytype/issues/1475
#
# PyType does not yet support Python 3.12 or later; if this step is
# enabled, it fails with an error: "Python versions > 3.11 are not yet
# supported."
if: ${{ (matrix.python != '3.13') && (matrix.python != '3.12') }}

- name: Check types with PyType
run: make pytype-test
# Mark this check optional for now, in case it starts out failing.
# We will make it required once we've fixed any existing issues.
continue-on-error: true
# https://github.com/google/pytype/issues/1475
#
# PyType does not yet support Python 3.12; if this step is enabled, it
# fails with an error: "Python versions > 3.11 are not yet supported."
if: ${{ matrix.python != '3.12' }}
# PyType does not yet support Python 3.12 or later; if this step is
# enabled, it fails with an error: "Python versions > 3.11 are not yet
# supported."
if: ${{ (matrix.python != '3.13') && (matrix.python != '3.12') }}
1 change: 1 addition & 0 deletions requirements-mypy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mypy ~= 1.9.0
1 change: 1 addition & 0 deletions requirements-pytype.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pytype ~= 2024.3.19
3 changes: 0 additions & 3 deletions requirements-test.txt

This file was deleted.

0 comments on commit 0401c76

Please sign in to comment.