diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9b5faa6..5a4a8fd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -5,9 +5,12 @@ on: push: jobs: - deploy: + versions: runs-on: ubuntu-latest + outputs: + py-versions: ${{ steps.supported-versions.outputs.py-versions }} + steps: - uses: actions/checkout@v4 @@ -22,7 +25,34 @@ jobs: poetry config virtualenvs.in-project true poetry install - - uses: wntrblm/nox@2024.04.15 + - id: supported-versions + name: Get supported versions + run: echo "py-versions=$(poetry run ./scripts/supported_py_versions.py)" >> "$GITHUB_OUTPUT" + + test: + runs-on: ubuntu-latest + + needs: versions + strategy: + matrix: + py-version: ${{ fromJson(needs.versions.outputs.py-versions) }} + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "${{ matrix.py-version }}" + + - name: Install dependencies + run: | + python -m pip install poetry + poetry config virtualenvs.in-project true + + # Only install main dependencies + poetry install --only=main + poetry install pytest - - name: Run unit tests - run: poetry run nox + - name: Run unit tests + run: poetry run pytest diff --git a/poetry.lock b/poetry.lock index aa9a75d..3b4d070 100644 --- a/poetry.lock +++ b/poetry.lock @@ -133,20 +133,6 @@ files = [ {file = "alabaster-0.7.16.tar.gz", hash = "sha256:75a8b99c28a5dad50dd7f8ccdd447a121ddb3892da9e53d1ca5cca3106d58d65"}, ] -[[package]] -name = "argcomplete" -version = "3.5.0" -description = "Bash tab completion for argparse" -optional = false -python-versions = ">=3.8" -files = [ - {file = "argcomplete-3.5.0-py3-none-any.whl", hash = "sha256:d4bcf3ff544f51e16e54228a7ac7f486ed70ebf2ecfe49a63a91171c76bf029b"}, - {file = "argcomplete-3.5.0.tar.gz", hash = "sha256:4349400469dccfb7950bb60334a680c58d88699bff6159df61251878dc6bf74b"}, -] - -[package.extras] -test = ["coverage", "mypy", "pexpect", "ruff", "wheel"] - [[package]] name = "astroid" version = "3.2.4" @@ -470,23 +456,6 @@ files = [ {file = "colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44"}, ] -[[package]] -name = "colorlog" -version = "6.8.2" -description = "Add colours to the output of Python's logging module." -optional = false -python-versions = ">=3.6" -files = [ - {file = "colorlog-6.8.2-py3-none-any.whl", hash = "sha256:4dcbb62368e2800cb3c5abd348da7e53f6c362dda502ec27c560b2e58a66bd33"}, - {file = "colorlog-6.8.2.tar.gz", hash = "sha256:3e3e079a41feb5a1b64f978b5ea4f46040a94f11f0e8bbb8261e3dbbeca64d44"}, -] - -[package.dependencies] -colorama = {version = "*", markers = "sys_platform == \"win32\""} - -[package.extras] -development = ["black", "flake8", "mypy", "pytest", "types-colorama"] - [[package]] name = "cryptography" version = "43.0.0" @@ -973,44 +942,6 @@ files = [ {file = "nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f"}, ] -[[package]] -name = "nox" -version = "2024.4.15" -description = "Flexible test automation." -optional = false -python-versions = ">=3.7" -files = [ - {file = "nox-2024.4.15-py3-none-any.whl", hash = "sha256:6492236efa15a460ecb98e7b67562a28b70da006ab0be164e8821177577c0565"}, - {file = "nox-2024.4.15.tar.gz", hash = "sha256:ecf6700199cdfa9e5ea0a41ff5e6ef4641d09508eda6edb89d9987864115817f"}, -] - -[package.dependencies] -argcomplete = ">=1.9.4,<4.0" -colorlog = ">=2.6.1,<7.0.0" -packaging = ">=20.9" -tomli = {version = ">=1", markers = "python_version < \"3.11\""} -virtualenv = ">=20.14.1" - -[package.extras] -tox-to-nox = ["jinja2", "tox"] -uv = ["uv (>=0.1.6)"] - -[[package]] -name = "nox-poetry" -version = "1.0.3" -description = "nox-poetry" -optional = false -python-versions = ">=3.7,<4.0" -files = [ - {file = "nox_poetry-1.0.3-py3-none-any.whl", hash = "sha256:a2fffeb70ae81840479e68287afe1c772bf376f70f1e92f99832a20b3c64d064"}, - {file = "nox_poetry-1.0.3.tar.gz", hash = "sha256:dc7ecbbd812a333a0c0b558f57e5b37f7c12926cddbcecaf2264957fd373824e"}, -] - -[package.dependencies] -nox = ">=2020.8.22" -packaging = ">=20.9" -tomlkit = ">=0.7" - [[package]] name = "packaging" version = "24.1" @@ -1531,17 +1462,6 @@ files = [ {file = "tomli-2.0.1.tar.gz", hash = "sha256:de526c12914f0c550d15924c62d72abc48d6fe7364aa87328337a31007fe8a4f"}, ] -[[package]] -name = "tomlkit" -version = "0.13.2" -description = "Style preserving TOML library" -optional = false -python-versions = ">=3.8" -files = [ - {file = "tomlkit-0.13.2-py3-none-any.whl", hash = "sha256:7a974427f6e119197f670fbbbeae7bef749a6c14e793db934baefc1b5f03efde"}, - {file = "tomlkit-0.13.2.tar.gz", hash = "sha256:fff5fe59a87295b278abd31bec92c15d9bc4a06885ab12bcea52c71119392e79"}, -] - [[package]] name = "typing-extensions" version = "4.12.2" @@ -1929,4 +1849,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = ">=3.9,<3.13" -content-hash = "27690dec4a15030e8b75dfc752b57b65e496701c5f4cf0864c8b01735948bfad" +content-hash = "ffb39222988e75a018ccff150f38616852f9d06aa37d2a9a14052ebbbc5b0602" diff --git a/pyproject.toml b/pyproject.toml index 062fb34..95cc786 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,10 +20,8 @@ sphinx = "^7.2.6" sphinx-autoapi = "^3.2.1" pyright = "^1.1.374" ruff = "0.5.6" -nox = "^2024.4.15" pytest = "^8.3.2" tomli = "^2.0.1" -nox-poetry = "^1.0.3" [tool.pyright] venvPath = "." diff --git a/noxfile.py b/scripts/supported_py_versions.py old mode 100644 new mode 100755 similarity index 80% rename from noxfile.py rename to scripts/supported_py_versions.py index 9de65c1..23c9743 --- a/noxfile.py +++ b/scripts/supported_py_versions.py @@ -1,10 +1,10 @@ -"""Configuration file for Nox.""" +#!/usr/bin/env python3 +import json from itertools import count from pathlib import Path from typing import Generator -import nox_poetry import tomli from packaging.specifiers import SpecifierSet from packaging.version import Version @@ -35,7 +35,4 @@ def get_python_versions() -> Generator[str, None, None]: return -@nox_poetry.session(python=list(get_python_versions())) -def test(session: nox_poetry.Session) -> None: - """Run unit tests.""" - session.run("pytest") +print(json.dumps(list(get_python_versions())))