-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathnoxfile.py
More file actions
46 lines (36 loc) · 1.34 KB
/
noxfile.py
File metadata and controls
46 lines (36 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
"""Nox sessions for MGT-python development."""
from __future__ import annotations
import nox
nox.options.sessions = ["tests", "lint"]
PYTHON_VERSIONS = ["3.10", "3.11", "3.12"]
@nox.session(python=PYTHON_VERSIONS)
def tests(session: nox.Session) -> None:
"""Run the test suite with pytest."""
session.install("-e", ".[dev]")
session.run("pytest", "tests/", "--tb=short", "-q", *session.posargs)
@nox.session(python="3.12")
def lint(session: nox.Session) -> None:
"""Run ruff linter and formatter check."""
session.install("ruff")
session.run("ruff", "check", "musicalgestures/", "--ignore", "E501")
session.run("ruff", "format", "--check", "musicalgestures/", success_codes=[0, 1])
@nox.session(python="3.12")
def typecheck(session: nox.Session) -> None:
"""Run mypy type checker."""
session.install("-e", ".[dev]")
session.run("mypy", "musicalgestures/", "--ignore-missing-imports", "--no-error-summary")
@nox.session(python="3.12")
def coverage(session: nox.Session) -> None:
"""Run tests with coverage reporting."""
session.install("-e", ".[dev]")
session.install("pytest-cov")
session.run(
"pytest",
"tests/",
"--cov=musicalgestures",
"--cov-report=term-missing",
"--cov-report=html:htmlcov",
"--tb=short",
"-q",
*session.posargs,
)