-
Notifications
You must be signed in to change notification settings - Fork 6
/
noxfile.py
27 lines (21 loc) · 979 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
"""Entrypoint for nox."""
import nox_poetry as nox
@nox.session(reuse_venv=True, python=["3.7", "3.8", "3.10"])
def tests(session):
"""Run all tests."""
session.run_always("poetry", "install", "-E", "all", "-vv", external=True)
cmd = ["poetry", "run", "pytest", "-n", "auto", "--mpl"]
if session.posargs:
cmd.extend(session.posargs)
session.run(*cmd)
@nox.session(reuse_venv=True, python=["3.7", "3.8", "3.10"])
def precommit_hooks(session):
"""Run all pre-commit hooks."""
session.run_always("poetry", "install", "-E", "all", "-vv", external=True)
session.run("pre-commit", "install")
session.run("pre-commit", "run", "--show-diff-on-failure", "--all-files")
@nox.session(reuse_venv=True, python=["3.7", "3.8", "3.10"])
def bandit(session):
"""Run all pre-commit hooks."""
session.run_always("poetry", "install", "-E", "all", "-vv", external=True)
session.run("bandit", "-r", "muttlib/", "-ll", "-c", "bandit.yaml")