diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index dbeb645..e371b1d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,13 +9,29 @@ on: pull_request: jobs: - build: + configure: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Read Python versions from pyproject.toml + id: read-versions + # produces output like: python_versions=[ "3.9", "3.10", "3.11", "3.12" ] + run: >- + python_versions=$( + grep -oP '(?<=Language :: Python :: )\d\.\d+' pyproject.toml + | jq --raw-input . + | jq --slurp . + ) >> $GITHUB_OUTPUT + outputs: + python_versions: ${{ steps.read-versions.outputs.python_versions }} + build: + needs: [configure] runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ${{ fromJSON(needs.configure.outputs.python_versions) }} steps: - uses: actions/checkout@v2 diff --git a/pyproject.toml b/pyproject.toml index 6f13c1b..97c4f33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,11 +9,15 @@ requires-python = ">= 3.9" classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", + + # The following classifiers are parsed by Github Actions workflows. + # Precise formatting is important (no extra spaces, etc.) "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", + "License :: OSI Approved :: BSD License", ]