-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
39 lines (30 loc) · 1023 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
import nox
import nox_poetry
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["tests", "mypy", "lint"]
@nox_poetry.session(python=["3.7", "3.8"])
def tests(session):
""" Run test suit."""
args = session.posargs or ["--cov"]
session.install("pytest", "pytest-cov", "coverage[toml]", ".")
session.run("pytest", *args)
@nox_poetry.session(python="3.8")
def lint(session):
""" Lint using flake8."""
args = session.posargs or []
session.install(
"flake8", "flake8-bugbear", "flake8-black", "flake8-isort",
)
session.run("flake8", *args)
@nox_poetry.session(python="3.8")
def mypy(session):
""" Type-check using mypy."""
args = session.posargs or ["src"]
session.install("mypy", ".")
session.run("mypy", *args)
@nox_poetry.session(python="3.8")
def codecov(session):
""" Upload coverage data to Codecov"""
session.install("codecov", "coverage[toml]")
session.run("coverage", "xml")
session.run("codecov", *session.posargs)