forked from sethmlarson/socksio
-
Notifications
You must be signed in to change notification settings - Fork 1
/
noxfile.py
43 lines (30 loc) · 1.35 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
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", "--recursive", "--apply", *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", "--recursive", "--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"])
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/")