-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
84 lines (66 loc) · 2.36 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
76
77
78
79
80
81
82
83
84
import nox
PYTHON_TEST_VERSIONS = ("3.8", "3.9", "3.10", "3.11", "3.12", "3.13")
PYTHON_DEVELOPMENT_VERSION = "3.11"
# for position arguments run:
# $ nox -s pytest-3.11 -- testfile
@nox.session(python=PYTHON_TEST_VERSIONS)
def pytest(session):
session.install("-e", ".")
session.install("pytest")
if session.posargs:
testfiles = [f"tests/{f}.py" for f in session.posargs]
else:
testfiles = ["tests"]
session.run("pytest", *testfiles)
@nox.session(name="check")
def ruff_check(session):
# local development setup:
# nox runs from a separate conda environment with also ruff installed.
# so ruff runs external and no session.install() calls are necessary.
session.run("ruff", "check", "autocron", external=True)
@nox.session(name="format")
def ruff_format(session):
# local development setup:
# nox runs from a separate conda environment with also ruff installed.
# so ruff runs external and no session.install() calls are necessary.
session.run("ruff", "format", "autocron", external=True)
@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 uppload_to_pypi(session):
session.install("-e", ".")
session.install("twine")
session.run("twine", "upload", "dist/*") #, "--verbose")
@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_build")
@nox.session
def sphinx_rtd(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.in"
)
session.install("-r", "docs/requirements.txt")
session.run("sphinx-build", "docs", "docs_build")