-
Notifications
You must be signed in to change notification settings - Fork 35
/
noxfile.py
56 lines (38 loc) · 1.53 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import nox
import nox_poetry
LINT_PATHS = ["vdom", "noxfile.py"]
nox.options.reuse_existing_virtualenv = True
nox.options.sessions = ["lint", "test"]
@nox_poetry.session(python=["3.8", "3.9", "3.10", "3.11"])
def test(session: nox_poetry.Session):
session.run_always("poetry", "install", external=True)
session.run("pytest", "-v", "--cov=vdom")
@nox_poetry.session(python="3.9")
def generate_coverage_xml(session: nox_poetry.Session):
session.install("coverage[toml]")
session.run("coverage", "xml")
@nox_poetry.session(python="3.9")
def lint(session: nox_poetry.Session):
session.notify("black_check")
session.notify("flake8")
session.notify("isort_check")
@nox_poetry.session(python="3.9")
def flake8(session: nox_poetry.Session):
session.install("flake8")
session.run("flake8", *LINT_PATHS, "--count", "--show-source", "--statistics", "--benchmark")
@nox_poetry.session(python="3.9")
def black_check(session: nox_poetry.Session):
session.install("black")
session.run("black", "--check", *LINT_PATHS)
@nox_poetry.session(python="3.9")
def isort_check(session: nox_poetry.Session):
session.install("isort")
session.run("isort", "--diff", "--profile", "black", "--check", *LINT_PATHS)
@nox_poetry.session(python="3.9")
def blacken(session: nox_poetry.Session):
session.install("black")
session.run("black", *LINT_PATHS)
@nox_poetry.session(python="3.9")
def isort_apply(session: nox_poetry.Session):
session.install("isort")
session.run("isort", *LINT_PATHS, "--profile", "black")