-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
44 lines (37 loc) · 1004 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
import tempfile
from typing import Any
import nox
from nox.sessions import Session
@nox.session(name="lint")
def lint(session):
session.run("poetry", "install", external=True)
session.run("poetry", "run", "mypy", "src")
@nox.session()
def tests(session: Session) -> None:
"""Run the test suite."""
session.run("poetry", "install", external=True)
session.run("poetry", "run", "pytest", external=True)
@nox.session(name="pre-commit")
def pre_commit(session: Session) -> None:
"""Run pre-commit."""
args = session.posargs or [
"run",
"--all-files",
"--hook-stage=manual",
"--show-diff-on-failure",
]
session.install(
"bandit",
"black",
"darglint",
"flake8",
"flake8-bugbear",
"flake8-docstrings",
"flake8-rst-docstrings",
"isort",
"pep8-naming",
"pre-commit",
"pre-commit-hooks",
"pyupgrade",
)
session.run("pre-commit", *args)