From a0028ef9ab0aee908b784a1c393283f2b8020310 Mon Sep 17 00:00:00 2001 From: Saransh Chopra Date: Tue, 8 Oct 2024 11:52:14 +0100 Subject: [PATCH] ci: python 3.13 support --- .github/workflows/ci.yml | 6 ++---- .pre-commit-config.yaml | 4 ++-- noxfile.py | 14 +++++++------- pyproject.toml | 3 +-- src/cuda_histogram/__init__.py | 3 +-- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af440d6..69bedcb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 @@ -51,9 +51,7 @@ jobs: allow-prereleases: true - name: Test package and generate coverage report - run: - pipx run nox -s coverage-${{ matrix.python-version.key || - matrix.python-version }} --verbose + run: pipx run nox -s coverage-${{ matrix.python-version }} --verbose - name: Upload coverage report uses: codecov/codecov-action@v4.6.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7a9db21..037ad4b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,8 +33,8 @@ repos: - id: rst-directive-colons - id: rst-inline-touching-normal - - repo: https://github.com/pre-commit/mirrors-prettier - rev: "v4.0.0-alpha.8" + - repo: https://github.com/rbubley/mirrors-prettier + rev: "v3.3.3" hooks: - id: prettier types_or: [yaml, markdown, html, css, scss, javascript, json] diff --git a/noxfile.py b/noxfile.py index 8936386..bf0903b 100644 --- a/noxfile.py +++ b/noxfile.py @@ -7,14 +7,14 @@ import nox DIR = Path(__file__).parent.resolve() -ALL_PYTHON = ["3.8", "3.9", "3.10", "3.11", "3.12"] +ALL_PYTHON = ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] nox.needs_version = ">=2024.3.2" -nox.options.sessions = ["lint", "pylint", "tests"] +nox.options.sessions = ["lint", "tests"] nox.options.default_venv_backend = "uv|virtualenv" -@nox.session +@nox.session(reuse_venv=True) def lint(session: nox.Session) -> None: """ Run the linter. @@ -25,7 +25,7 @@ def lint(session: nox.Session) -> None: ) -@nox.session(python=ALL_PYTHON) +@nox.session(reuse_venv=True, python=ALL_PYTHON) def tests(session: nox.Session) -> None: """ Run the unit and regular tests. @@ -34,7 +34,7 @@ def tests(session: nox.Session) -> None: session.run("pytest", *session.posargs) -@nox.session(python=ALL_PYTHON) +@nox.session(reuse_venv=True, python=ALL_PYTHON) def coverage(session: nox.Session) -> None: """Run tests and compute coverage.""" session.posargs.append("--cov=cuda_histogram") @@ -83,7 +83,7 @@ def docs(session: nox.Session) -> None: session.run("sphinx-build", "--keep-going", *shared_args) -@nox.session +@nox.session(reuse_venv=True) def build_api_docs(session: nox.Session) -> None: """ Build (regenerate) API docs. @@ -102,7 +102,7 @@ def build_api_docs(session: nox.Session) -> None: ) -@nox.session +@nox.session(reuse_venv=True) def build(session: nox.Session) -> None: """ Build an SDist and wheel. diff --git a/pyproject.toml b/pyproject.toml index bd9ed9b..2ee373e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,6 +30,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering", "Typing :: Typed", ] @@ -113,8 +114,6 @@ disallow_incomplete_defs = true [tool.ruff] -src = ["src"] - [tool.ruff.lint] extend-select = [ "B", # flake8-bugbear diff --git a/src/cuda_histogram/__init__.py b/src/cuda_histogram/__init__.py index 135c5f4..29d6040 100644 --- a/src/cuda_histogram/__init__.py +++ b/src/cuda_histogram/__init__.py @@ -9,10 +9,9 @@ from __future__ import annotations from cuda_histogram import axis +from cuda_histogram._version import version as __version__ from cuda_histogram.hist import Hist -from ._version import version as __version__ - __all__: list[str] = [ "Hist", "axis",