-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathnoxfile.py
44 lines (34 loc) · 904 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
37
38
39
40
41
42
43
44
"""Nox configuration."""
import nox
SOURCES = ["noxfile.py", "black_nb", "tests"]
@nox.session()
def mypy(session):
"""Type check code with mypy."""
session.install("mypy")
session.run(
"mypy",
"--strict",
"--allow-untyped-decorators",
"--install-types",
"--non-interactive",
"black_nb",
)
@nox.session()
def flake8(session):
"""Lint code with Flake8."""
session.install("flake8")
session.run("flake8", *SOURCES)
@nox.session()
def black(session):
"""Check code formatting with black."""
session.install("black==21.4b0")
if session.posargs:
session.run("black", *session.posargs)
else:
session.run("black", "--check", *SOURCES)
@nox.session()
def test(session):
"""Test"""
session.install("pytest")
session.install("-e", ".")
session.run("pytest", "black_nb", "tests/")