-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnoxfile.py
36 lines (25 loc) · 955 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
34
35
36
import nox
locations = "blockscan", "tests", "noxfile.py"
@nox.session(python=["3.8", "3.9", "3.10"])
def tests(session):
session.install("-e", ".")
session.install("-r", "tests/requirements.txt")
session.run("pytest")
@nox.session(reuse_venv=True, python="3.10")
def black(session):
"""Run black code formatter."""
session.install("black")
session.run("black", *locations)
@nox.session(reuse_venv=True, python="3.10")
def lint(session):
session.install("flake8", "black")
session.run("flake8", "--version")
session.run("black", "--version")
session.run("black", "--check", *locations)
session.run("flake8", *locations)
@nox.session(reuse_venv=True, python="3.10")
def docs(session):
session.install("-e", ".")
session.install("-r", "docs/requirements.txt")
# Generate documentation into `build/docs`
session.run("sphinx-build", "-W", "-b", "html", "-v", "docs/", "docs/_build/html")