-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathnoxfile.py
64 lines (51 loc) · 1.27 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
57
58
59
60
61
62
63
64
import nox
PYTHON_FILES = [
"yoga",
"test",
"setup.py",
"noxfile.py",
]
PYTHON_VERSIONS = ["3.9", "3.10", "3.11", "3.12", "3.13"]
@nox.session(reuse_venv=True)
def lint(session):
session.install("flake8", "black", "codespell")
session.run("flake8", *PYTHON_FILES)
session.run(
"black",
"--line-length=79",
"--check",
"--diff",
"--color",
*PYTHON_FILES,
)
session.run(
"codespell",
"-L",
"ans,alph,ccompiler",
"doc/",
"scripts/",
"test/",
"winbuild/",
"yoga/",
"noxfile.py",
"README.rst",
"setup.py",
)
@nox.session(reuse_venv=True)
def black_fix(session):
session.install("black")
session.run("black", *PYTHON_FILES)
@nox.session(python=PYTHON_VERSIONS, reuse_venv=True)
def test(session):
session.install("pytest")
session.install(".")
session.run("pytest", "-v", "test")
@nox.session(reuse_venv=False)
def test_build_wheel(session):
session.install("build")
session.run("python", "-m", "build")
@nox.session(reuse_venv=True)
def gendoc(session):
session.install("sphinx", "sphinx-rtd-theme")
session.install(".")
session.run("sphinx-build", "-M", "html", "doc", "build")