-
Notifications
You must be signed in to change notification settings - Fork 11
/
noxfile.py
41 lines (28 loc) · 1.31 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
import nox
nox.options.stop_on_first_error = True
source_files = ("socksio", "tests/", "noxfile.py", "examples/", "docs/source/")
@nox.session()
def lint(session):
session.install("autoflake", "black", "flake8", "isort", "seed-isort-config")
session.run("autoflake", "--in-place", "--recursive", *source_files)
session.run("seed-isort-config", "--application-directories=socksio")
session.run("isort", "--project=socksio", *source_files)
session.run("black", "--target-version=py36", *source_files)
check(session)
@nox.session(reuse_venv=True)
def check(session):
session.install(
"black", "flake8", "flake8-bugbear", "flake8-comprehensions", "mypy", "isort"
)
session.run("isort", "--project=socksio", "--check-only", *source_files)
session.run("black", "--check", "--diff", "--target-version=py36", *source_files)
session.run("flake8", *source_files)
session.run("mypy", "--strict", "socksio")
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10"])
def test(session):
session.install("-r", "test-requirements.txt")
session.run("python", "-m", "pytest", *session.posargs)
@nox.session(reuse_venv=True)
def docs(session):
session.install("sphinx", "sphinx_rtd_theme", ".")
session.run("sphinx-build", "-b", "html", "docs/source/", "docs/build/html/")