Skip to content

Commit

Permalink
ci: update GitHub workflows and fix development dependencies for Pyth…
Browse files Browse the repository at this point in the history
…on 3.12 (#75)

Improves CI workflows and ensures reliable test environments.  

- GitHub Actions:
  - Add support for testing with Python 3.12.
  - Remove testing for Python 3.7 on macOS (EOL).
  - Remove `allow-prereleases` to focus on stable releases.
  - Simplify dependencies by only installing pytest (and pkg_resources)

- setup.py and tox.ini:
  - Fix development dependencies for unit tests.
  - Add setuptools explicitly for pkg_resources compatibility (Python 3.12+).
  • Loading branch information
laurent-laporte-pro authored Nov 15, 2024
2 parents e4d1379 + d87ab55 commit abcb4e9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
12 changes: 8 additions & 4 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,22 +12,26 @@ on:
jobs:
pytest:
strategy:
fail-fast: false
matrix:
platform: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
exclude:
- platform: macos-latest
python-version: "3.7"

runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install 'PyTest'
python -m pip install pytest setuptools
python -m pip install -e .
- name: Test with pytest
run: |
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ def function_three():
'sphinx < 2',
# jinja2 3.0.3 was the last version to have contextfunction that sphinx 1.x needs
'jinja2~=3.0.3',
'setuptools; python_version>="3.12"',
]
},
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
Expand Down
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ deps =
wrapt1.13: wrapt ~= 1.13.0
wrapt1.14: wrapt ~= 1.14.0
coverage
setuptools; python_version>="3.12"

[testenv:docs]
basepython = python
Expand Down

0 comments on commit abcb4e9

Please sign in to comment.