-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
33 lines (24 loc) · 871 Bytes
/
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
from glob import glob
import nox
# Run everything but 'dist' by default
nox.options.keywords = "not dist"
@nox.session(python=["3.8", "3.9", "3.10"], reuse_venv=True)
def test(session):
session.install("-e", ".")
session.run("python", "-m", "doctest", *glob("src/*.py"))
session.run("python", "-m", "unittest", "discover", *session.posargs)
@nox.session(reuse_venv=True)
def format(session):
session.install("-e", ".[dev]")
session.run("black", ".")
@nox.session(reuse_venv=True)
def lint(session):
session.install("-e", ".[dev]")
session.run("flake8")
@nox.session(reuse_venv=True)
def dist(session):
session.install("-e", ".[dist]")
session.run("check-manifest")
session.run("python", "setup.py", "bdist_wheel", "sdist")
session.run("twine", "upload", *glob("dist/*"))
print("*** Don't forget to tag and push!")