Skip to content
Draft
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
18 changes: 17 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,26 @@ jobs:
with:
token: ${{ secrets.CODECOV_TOKEN }}

test_mutation:
name: Mutation Testing
runs-on: ubuntu-latest
needs: [format]
steps:
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1

- name: Install uv
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7.1.6

- name: Install
run: uv sync --no-default-groups --group nox --group test --locked

- name: Gremlins
run: uv run --frozen nox -s pytest_gremlins

status:
name: CI Pass
runs-on: ubuntu-latest
needs: [format, tests, test_oldest]
needs: [format, tests, test_oldest, test_mutation]
if: always()
steps:
- name: All required jobs passed
Expand Down
19 changes: 14 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
@session(uv_groups=["lint"], reuse_venv=True, default=True)
def lint(s: nox.Session, /) -> None:
"""Run the linter."""
s.notify("precommit")
s.notify("pylint")
s.notify("mypy")
s.run("precommit")
s.run("pylint")
s.run("mypy")


@session(uv_groups=["lint"], reuse_venv=True)
Expand All @@ -49,18 +49,27 @@ def mypy(s: nox.Session, /) -> None:
# Testing


@session(uv_groups=["test"], reuse_venv=True, default=True)
@session(python=False, default=True)
def test(s: nox.Session, /) -> None:
"""Run the unit and regular tests."""
s.notify("pytest", posargs=s.posargs)
s.notify("pytest_gremlins", posargs=s.posargs)


@session(uv_groups=["test"], reuse_venv=True)
@session(uv_groups=["test_cov"], reuse_venv=True)
def pytest(s: nox.Session, /) -> None:
"""Run the unit and regular tests."""
s.run("pytest", *s.posargs)


@session(uv_groups=["test_mutation"], reuse_venv=True)
def pytest_gremlins(s: nox.Session, /) -> None:
"""Run pytest-gremlins (without coverage, which conflicts with gremlins)."""
# Filter out --cov from posargs since it conflicts with gremlins
filtered_args = [arg for arg in s.posargs if not arg.startswith("--cov")]
s.run("pytest", "--gremlins", "tests", *filtered_args)


# =============================================================================
# Build

Expand Down
11 changes: 6 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@ dev = [
]
lint = ["mypy>=1.19.0", "pre-commit>=4.5.0", "pylint>=4.0.4"]
nox = ["nox>=2024.10.9", "nox-uv>=0.6.3"]
test = [
"attrs>=25.4.0",
"pytest>=8.4.2",
"pytest-cov>=7.0.0",
"sybil[pytest]>=9.2.0",
test = ["pytest>=9.0.0", "sybil[pytest]>=9.2.0"]
test_cov = [{ "include-group" = "test" }, "pytest-cov>=4.0.0", "attrs>=25.4.0"]
test_mutation = [
{ "include-group" = "test" },
"pytest-gremlins>=1.5.1", # fails if `pytest-cov` is installed
"pytest-xdist>=3.8.0",
]

[tool.hatch]
Expand Down
65 changes: 58 additions & 7 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading