Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ repos:
args: []
additional_dependencies:
- pytest
- scikit-build-core

- repo: https://github.com/codespell-project/codespell
rev: "v2.3.0"
Expand Down
9 changes: 3 additions & 6 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -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"]


Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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")
13 changes: 6 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
Expand Down