From 26c561d1dae56ce7551fbc04608094a2236884aa Mon Sep 17 00:00:00 2001 From: Christoph Noetel Date: Mon, 11 May 2026 14:17:49 +0200 Subject: [PATCH] ci: modernize test workflow and fix Python 3.12+ compatibility MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Update actions/checkout@v2 → v4, actions/setup-python@v2 → v5 - Drop EOL Python versions (3.7, 3.8) — both reached end-of-life - Add Python 3.12 and 3.13 to the test matrix - Replace distutils with setuptools in setup.py (distutils removed in 3.12) - Bump python_requires to >=3.9 - Add PyPI classifiers for supported Python versions - Remove unnecessary system package (libgirepository1.0-dev) - Use fail-fast: false so all matrix jobs complete - Simplify test step to use unittest discover (matches existing test structure) All 29 existing tests pass on Python 3.13. --- .github/workflows/test.yml | 27 +++++++++++++-------------- setup.py | 22 +++++++++++++++++----- 2 files changed, 30 insertions(+), 19 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d176d94..c870232 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,32 +1,31 @@ -# 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 +# Run tests and lint across supported Python versions +# https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions name: test -on: [ push, pull_request] +on: [push, pull_request] jobs: - build: - + test: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.x'] + python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - sudo apt install -y libgirepository1.0-dev python -m pip install --upgrade pip - python -m pip install flake8 pytest - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + python -m pip install flake8 coverage + python -m pip install -e . - name: Lint with flake8 run: | @@ -37,6 +36,6 @@ jobs: - name: Run tests run: | - if [ -f requirements-test.txt ]; then pip install -r requirements-test.txt; fi - python -m unittest discover -s tests - coverage run run_tests.py && coverage report -m + python -m unittest discover -s tests -v + coverage run -m unittest discover -s tests + coverage report -m diff --git a/setup.py b/setup.py index ad51427..ace8461 100644 --- a/setup.py +++ b/setup.py @@ -1,12 +1,11 @@ -from distutils.core import setup +from setuptools import setup import sys import fitparse -requires = None -if sys.version_info < (3, 6): - sys.exit("Python 3.6+ is required.") +if sys.version_info < (3, 9): + sys.exit("Python 3.9+ is required.") setup( @@ -19,5 +18,18 @@ license=open('LICENSE').read(), packages=['fitparse'], scripts=['scripts/fitdump'], # Don't include generate_profile.py - install_requires=requires, + python_requires='>=3.9', + install_requires=[], + classifiers=[ + 'Development Status :: 5 - Production/Stable', + 'Intended Audience :: Developers', + 'License :: OSI Approved :: MIT License', + 'Programming Language :: Python :: 3', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Programming Language :: Python :: 3.13', + 'Topic :: Scientific/Engineering', + ], )