forked from alec-kr/F1PyStats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
43 lines (32 loc) · 1.05 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
from nox_poetry import session
locations = "f1pystats", "tests", "noxfile.py", "docs/conf.py"
@session(python=['3.8'])
def lint(session) -> None:
"""Runs linting for the package."""
args = session.posargs or locations
session.install("flake8",
"flake8-black",
"flake8-import-order",
"flake8-bugbear",
"flake8-annotations",
"flake8-docstrings",
"darglint")
session.run("flake8", *args)
@session(python=["3.8"])
def mypy(session) -> None:
"""Runs type checking the package."""
args = session.posargs or locations
session.run("mypy", *args)
@session(python='3.8')
def tests(session) -> None:
"""Run all tests."""
pass
@session(python='3.8')
def code_coverage(session) -> None:
"""Run package coverage."""
pass
@session(python="3.8")
def docs(session) -> None:
"""Build the documentation."""
session.install("sphinx", "sphinx-autodoc-typehints")
session.run("sphinx-build", "docs", "docs/_build")