Skip to content

Commit

Permalink
Update Python version support (#178)
Browse files Browse the repository at this point in the history
* Add Python 3.11 to workflows for testing

* Fix invalid syntax for Python version matrix

* Add Python 3.10 to version matrix

* Add Python 3.9 to version matrix

* Add Python 3.8 to version matrix

* Remove Python 3.8 from version matrix

PittAPI is currently incompatible with Python 3.8 because alabaster
package requires >= 3.9

* Update Python version string in GitHub Actions workflows

* Add `from __future__ import annotations`

Add the import `from __future__ import annotations` to Python files that
use the pipe operator (`A | B` instead of `Union[A, B]`) in order to
maintain compatibility with Python 3.9
  • Loading branch information
tianyizheng02 authored Jun 13, 2024
1 parent a9d8aac commit 51b925a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/autotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ on:
jobs:
run-test-suite:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: "3.12"
python-version: ${{ matrix.python }}
# https://github.com/actions/cache/blob/main/examples.md#python---pip
- uses: actions/cache@v4
with:
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/tests-on-push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ permissions:
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.12
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: "3.12"
python-version: ${{ matrix.python }}
# https://github.com/actions/cache/blob/main/examples.md#python---pip
- uses: actions/cache@v4
with:
Expand Down
2 changes: 2 additions & 0 deletions pittapi/course.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

from __future__ import annotations

import re
import requests
from typing import NamedTuple
Expand Down
2 changes: 2 additions & 0 deletions pittapi/laundry.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

from __future__ import annotations

import requests
from typing import Any

Expand Down

0 comments on commit 51b925a

Please sign in to comment.