-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
37 lines (26 loc) · 1.11 KB
/
noxfile.py
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
from nox import options, parametrize
from nox_poetry import Session, session
options.sessions = ["test", "coverage", "lint"]
@session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
def test(s: Session):
s.install(".", "pytest", "pytest-cov")
s.env["COVERAGE_FILE"] = f".coverage.{s.python}"
s.run("python", "-m", "pytest", "--cov", "tabeline")
@session(python=["3.9", "3.10", "3.11", "3.12", "3.13"])
def test_pandas(s: Session):
s.install(".[pandas]", "pytest", "pytest-cov")
s.env["COVERAGE_FILE"] = f".coverage.pandas.{s.python}"
s.run("python", "-m", "pytest", "--cov", "tabeline", "tests/test_pandas_conversion.py")
@session(venv_backend="none")
def coverage(s: Session):
s.run("coverage", "combine")
s.run("coverage", "html")
s.run("coverage", "xml")
@session(venv_backend="none")
@parametrize("command", [["ruff", "check", "."], ["ruff", "format", "--check", "."]])
def lint(s: Session, command: list[str]):
s.run(*command)
@session(venv_backend="none")
def format(s: Session) -> None:
s.run("ruff", "check", ".", "--select", "I", "--fix")
s.run("ruff", "format", ".")