diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b1f7a9f..07b63df 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -66,14 +66,6 @@ Use pytest to run the unit checks: pytest ``` -# Coverage - -Use pytest-cov to generate coverage reports: - -```bash -pytest --cov=cython-cmake -``` - # Building docs You can build the docs using: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f31195..6dee1a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,13 +57,10 @@ jobs: python-version: ${{ matrix.python-version }} allow-prereleases: true + - uses: yezz123/setup-uv@v4 + - name: Install package - run: python -m pip install .[test] + run: uv pip install --system -e.[test] - name: Test package - run: >- - python -m pytest -ra --cov --cov-report=xml --cov-report=term - --durations=20 - - - name: Upload coverage report - uses: codecov/codecov-action@v4.5.0 + run: python -m pytest --durations=20 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6cf7b00..ef52a37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -55,6 +55,7 @@ repos: args: [] additional_dependencies: - pytest + - scikit-build-core - repo: https://github.com/codespell-project/codespell rev: "v2.3.0" diff --git a/noxfile.py b/noxfile.py index 1b10b63..7418204 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,13 +1,14 @@ from __future__ import annotations import argparse -import shutil from pathlib import Path import nox DIR = Path(__file__).parent.resolve() +nox.needs_version = ">=2024.3.2" +nox.options.default_venv_backend = "uv|virtualenv" nox.options.sessions = ["lint", "pylint", "tests"] @@ -38,7 +39,7 @@ def tests(session: nox.Session) -> None: """ Run the unit and regular tests. """ - session.install(".[test]") + session.install("-e.[test]") session.run("pytest", *session.posargs) @@ -109,9 +110,5 @@ def build(session: nox.Session) -> None: Build an SDist and wheel. """ - build_path = DIR.joinpath("build") - if build_path.exists(): - shutil.rmtree(build_path) - session.install("build") session.run("python", "-m", "build") diff --git a/pyproject.toml b/pyproject.toml index b722c13..f1caf73 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,11 +38,8 @@ any = "cython_cmake.cmake" [project.optional-dependencies] test = [ "pytest >=6", - "pytest-cov >=3", -] -dev = [ - "pytest >=6", - "pytest-cov >=3", + "scikit-build-core", + "cython", ] docs = [ "sphinx>=7.0", @@ -64,9 +61,11 @@ version.source = "vcs" build.hooks.vcs.version-file = "src/cython_cmake/_version.py" [tool.hatch.envs.default] -features = ["test"] -scripts.test = "pytest {args}" +installer = "uv" +[tool.hatch.envs.hatch-test] +features = ["test"] +extra-dependencies = ["cmake", "ninja"] [tool.pytest.ini_options] minversion = "6.0"