Skip to content

Commit

Permalink
🐍 Ensure support for Python 3.12/3.8/3.7
Browse files Browse the repository at this point in the history
The README claims that Python 3.7 or higher is required,
so I believe it would be nice to ensure that all 3.7+
versions are actually supported by enabling testing
against them on CI.

These changes also:
  - add coverage reporting
  - disable fail-fast mode for tests
  - make CI use pipx to install poetry
  - make CI use pytest to run tests
  - force colors on CI
  - bump actions/checkout to v4
  - bump actions/setup-python to v5
  • Loading branch information
Jamim committed Jan 23, 2024
1 parent f517463 commit 14a27ee
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can check out the head.
Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,34 @@ on:
- ".github/workflows/test.yml"
- "**.py"

env:
FORCE_COLOR: '1'

jobs:
test:
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11"]
python:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
- "3.7"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Setup Graphviz
uses: ts-graphviz/setup-graphviz@v1
- name: Install poetry
run: curl -sSL https://install.python-poetry.org | python3 -
- name: Run all tests
run: |
poetry install
poetry run python -m unittest -v tests/*.py
pipx install poetry
poetry env use ${{ matrix.python }}
- name: Install dependencies
run: poetry install
- name: Run all tests
run: poetry run pytest
126 changes: 95 additions & 31 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 14a27ee

Please sign in to comment.