-
Notifications
You must be signed in to change notification settings - Fork 60
/
noxfile.py
75 lines (55 loc) · 2 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
65
66
67
68
69
70
71
72
73
74
75
import nox
PYTHON_TEST_VERSIONS = ("3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13")
PYTHON_DEVELOPMENT_VERSION = "3.11"
@nox.session(python=PYTHON_TEST_VERSIONS)
def test(session):
session.install("-e", ".")
session.install("requests", "pytest")
session.run("pytest", "-m", "not routertest")
@nox.session(python=PYTHON_TEST_VERSIONS)
def test_router(session):
session.install("-e", ".")
session.install("requests", "pytest")
session.run("pytest", "-m", "routertest")
@nox.session(python=PYTHON_TEST_VERSIONS)
def test_all(session):
session.install("-e", ".")
session.install("requests", "pytest")
session.run("pytest")
@nox.session(name="check")
def ruff_check(session):
session.run("ruff", "check", "fritzconnection", external=True)
@nox.session
def mypy(session):
session.install("-e", ".")
session.install("mypy==1.11.1", "types-requests", "segno")
session.run("mypy", "fritzconnection/core/fritzconnection.py")
session.run("mypy", "fritzconnection/core/fritzmonitor.py")
session.run("mypy", "fritzconnection/lib")
@nox.session
def sphinx(session):
session.install("-e", ".")
session.install("pip-tools==7.3.0")
session.run(
"pip-compile",
"--strip-extras",
"-q",
"--output-file=docs/requirements.txt",
"docs/requirements.local.in"
)
session.install("-r", "docs/requirements.txt")
session.run("sphinx-build", "docs", "docs_out")
@nox.session(python=PYTHON_DEVELOPMENT_VERSION)
def build(session):
session.install("-e", ".")
session.run("python", "setup.py", "sdist", "bdist_wheel")
@nox.session(name="check-twine", python=PYTHON_DEVELOPMENT_VERSION)
def check_twine(session):
session.install("-e", ".")
session.install("twine")
session.run("twine", "check", "dist/*")
@nox.session(name="upload-to-pypi", python=PYTHON_DEVELOPMENT_VERSION)
def upload_to_pypi(session):
session.install("-e", ".")
session.install("twine")
session.run("twine", "upload", "dist/*")