-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
51 lines (35 loc) · 1.29 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
44
45
46
47
48
49
50
51
"""Entrypoint for nox."""
import nox
@nox.session(reuse_venv=True)
def tests(session):
"""Run all tests."""
session.install("poetry")
session.run("poetry", "install", "-E", "testing")
cmd = ["pytest", "-n", "auto"]
if session.posargs:
cmd.extend(session.posargs)
session.run(*cmd)
@nox.session(reuse_venv=True)
def cop(session):
"""Run all pre-commit hooks."""
session.install("poetry")
session.run("poetry", "install")
session.run("pre-commit", "install")
session.run("pre-commit", "run", "--show-diff-on-failure", "--all-files")
@nox.session(reuse_venv=True)
def bandit(session):
"""Run all pre-commit hooks."""
session.install("poetry")
session.run("poetry", "install")
session.run("bandit", "-r", "booking_microservice/", "-ll", "-c", "bandit.yaml")
@nox.session(reuse_venv=True)
def pyreverse(session):
"""Create class diagrams."""
session.install("poetry")
session.run("poetry", "install")
# TODO: create smaller diagrams with portions of the project.
session.run("pyreverse", "booking_microservice", "-o", "png")
session.run(
"mv", "packages.png", "docs/images/packages_dependencies.png", external=True
)
session.run("mv", "classes.png", "docs/images/project_classes.png", external=True)