Skip to content

Commit

Permalink
Attempt to pin Python versions to classifiers
Browse files Browse the repository at this point in the history
Thanks to some magic from Hynek
  • Loading branch information
treyhunner committed May 10, 2024
1 parent 42c9803 commit efa23da
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ on:
- pull_request

jobs:
build-package:
name: Build & inspect our package.
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: hynek/build-and-inspect-python-package@v2
id: baipp
outputs:
python-versions: ${{ steps.baipp.outputs.supported_python_classifiers_json_array }}
tests:
name: ${{ matrix.session }} ${{ matrix.python }} / ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -32,7 +42,7 @@ jobs:
- name: Set up Python ${{ matrix.python }}
uses: actions/[email protected]
with:
python-version: ${{ matrix.python }}
python-version: ${{ fromJson(needs.check-package.outputs.python-versions) }}

- name: Upgrade pip
run: |
Expand Down
9 changes: 8 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from textwrap import dedent

import nox
import tomllib


try:
from nox_poetry import session
Expand All @@ -19,7 +21,12 @@


package = "countdown"
python_versions = ["3.10", "3.9", "3.8"]
config = tomllib.loads(Path("pyproject.toml").read_text())
python_versions = [
classifier.split()[-1]
for classifier in config["tool"]["poetry"]["classifiers"]
if classifier.startswith("Programming Language :: Python :: ")
]
nox.needs_version = ">= 2021.6.6"
nox.options.sessions = ("pre-commit", "tests")

Expand Down
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ packages = [
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]

[tool.poetry.urls]
Expand Down

0 comments on commit efa23da

Please sign in to comment.