forked from pdfminer/pdfminer.six
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
63 lines (53 loc) · 1.32 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
import os
import nox
PYTHON_ALL_VERSIONS = ["3.8", "3.9", "3.10", "3.11", "3.12"]
PYTHON_MODULES = ["fuzzing", "pdfminer", "tools", "tests", "noxfile.py", "setup.py"]
@nox.session
def format(session):
session.install("ruff==0.5.1")
# Format files locally with black, but only check in cicd
if "CI" in os.environ:
session.run("ruff", "check")
session.run("ruff", "format", "--check")
else:
session.run("ruff", "check", "--fix")
session.run("ruff", "format")
@nox.session
def types(session):
session.install("mypy<1")
session.run(
"mypy",
"--install-types",
"--non-interactive",
"--show-error-codes",
*PYTHON_MODULES,
)
@nox.session(python=PYTHON_ALL_VERSIONS)
def tests(session):
session.install("pip")
session.install("setuptools")
session.install("-e", ".[dev]")
session.run("pytest")
@nox.session
def docs(session):
session.install("pip")
session.install("setuptools")
session.install("-e", ".[docs]")
session.run(
"python",
"-m",
"sphinx",
"-b",
"html",
"docs/source",
"docs/build/html",
)
session.run(
"python",
"-m",
"sphinx",
"-b",
"doctest",
"docs/source",
"docs/build/doctest",
)