diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4ec21c..5726748 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.11, 3.12, 3.13] + python-version: [3.12, 3.13, 3.14] os: [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.os }} steps: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index b701d24..6ec0cce 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -10,13 +10,10 @@ build: - libsndfile1 tools: python: "3.13" + jobs: + install: + - python -m pip install --no-cache-dir "pip >= 25.1" + - python -m pip install --upgrade --upgrade-strategy only-if-needed --no-cache-dir --group doc . sphinx: configuration: doc/conf.py - -python: - install: - - method: pip - path: . - extra_requirements: - - doc diff --git a/noxfile.py b/noxfile.py index 8bdb03d..7654ca5 100644 --- a/noxfile.py +++ b/noxfile.py @@ -13,26 +13,12 @@ TEST_PYTHONS = [ - "3.11", "3.12", "3.13", + "3.14", ] -@nox.session -def build(session: nox.Session) -> None: - """ - Build an SDist and wheel with ``flit``. - """ - - dist_dir = DIR.joinpath("dist") - if dist_dir.exists(): - shutil.rmtree(dist_dir) - - session.install(".[dev]") - session.run("flit", "build") - - @nox.session(python=TEST_PYTHONS[1]) def dev(session: nox.Session) -> None: """ @@ -58,7 +44,9 @@ def dev(session: nox.Session) -> None: # Use the venv's interpreter to install the project along with # all it's dev dependencies, this ensures it's installed in the right way - session.run(python, "-m", "pip", "install", "-e", ".[dev,test,doc]", external=True) + pyproject = nox.project.load_toml("pyproject.toml") + session.install(*nox.project.dependency_groups(pyproject, "dev")) + session.run(python, "-m", "pip", "install", "-e", ".", external=True) @nox.session(python=TEST_PYTHONS[1]) @@ -66,9 +54,9 @@ def lint(session): """ Run the linter. """ - session.install(".[dev]") - # run isort first since black disagrees with it - session.run("isort", "./src") + pyproject = nox.project.load_toml("pyproject.toml") + session.install(*nox.project.dependency_groups(pyproject, "lint")) + session.run("isort", "./src") # run isort first since black disagrees with it session.run("black", "./src", "--line-length=120") session.run("flake8", "./src", "--max-line-length", "120", "--exclude", "./src/crowsetta/_vendor") @@ -78,7 +66,9 @@ def test(session) -> None: """ Run the unit and regular tests. """ - session.install(".[test]") + session.install(".") + pyproject = nox.project.load_toml("pyproject.toml") + session.install(*nox.project.dependency_groups(pyproject, "test")) session.run("pytest", "-n", "auto", *session.posargs) @@ -87,9 +77,12 @@ def coverage(session) -> None: """ Run the unit and regular tests, and save coverage report """ - session.install(".[test]", "pytest-cov") + session.install(".") + pyproject = nox.project.load_toml("pyproject.toml") + session.install(*nox.project.dependency_groups(pyproject, "test")) + session.install("pytest-cov") session.run( - "pytest", "-n", "auto", "--cov=./", "--cov-report=xml", *session.posargs + "pytest", "-n", "auto", "--cov=crowsetta", "--cov-report=xml", *session.posargs ) @@ -106,7 +99,9 @@ def doc(session: nox.Session) -> None: Otherwise the docs will be built once using """ - session.install(".[doc]") + session.install(".") + pyproject = nox.project.load_toml("pyproject.toml") + session.install(*nox.project.dependency_groups(pyproject, "doc")) if session.posargs: if "autobuild" in session.posargs: print("Building docs at http://127.0.0.1:8000 with sphinx-autobuild -- use Ctrl-C to quit") diff --git a/pyproject.toml b/pyproject.toml index 621a429..e6a2592 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,12 +8,12 @@ description = "A Python tool to work with any format for annotating animal sound authors = [ {name = "David Nicholson", email = "nickledave@users.noreply.github.com"} ] -requires-python = ">=3.11" +requires-python = ">=3.12" dependencies = [ "appdirs >=1.4.4", "attrs >=25.3.0", - "numpy >=1.26.0", - "pandas >= 2.1.0", + "numpy >=2.0.0", + "pandas >= 2.2.0", "pandera >= 0.25.0", "scipy >=1.12.0", "SoundFile >=0.13.1", @@ -32,14 +32,14 @@ classifiers = [ 'Programming Language :: Python :: Implementation :: CPython', ] -[project.optional-dependencies] +[dependency-groups] test = [ "pytest >=6.2.1", "pytest-cov >=2.12.0", "pytest-xdist >=3.2.0", ] doc = [ - "ipython != 8.7.0", + "ipython >= 8.20.0", "jupyterlab >=3.0.3", "jupytext >=1.13.8", "librosa >=0.9.1", @@ -54,16 +54,21 @@ doc = [ "sphinxext-opengraph >=0.5.1", "sphinx-tabs >= 3.3.1", ] -dev = [ +lint = [ 'black >=23.1.0', - 'crowsetta[doc, test]', 'flake8 >=6.0.0', - 'flit', 'isort >=5.12.0', 'pycln >=2.1.3', +] +dev = [ 'twine', + {include-group = "lint"}, + {include-group = "test"}, + {include-group = "doc"}, + ] + [project.urls] Source = "https://github.com/vocalpy/crowsetta" Documentation = "https://crowsetta.readthedocs.io"