-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
40 lines (28 loc) · 931 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
import nox
import platform
nox.options.sessions = ["format", "lint", "test"]
def _install(session):
# M1 Mac workaround for grpcio
if platform.system() == "Darwin":
session.install("--no-binary", ":all:", "grpcio")
session.install("-r", "test-requirements.txt")
@nox.session(python="3.10", reuse_venv=True)
def dev(session):
"""A development virtual environment."""
_install(session)
@nox.session(python="3.10", reuse_venv=True)
def format(session):
session.install("black")
session.run("black", "microservice_utils", "tests", *session.posargs)
@nox.session(python="3.10", reuse_venv=True)
def lint(session):
session.install("flake8")
session.run("flake8", "microservice_utils", "tests")
@nox.session(python=["3.9", "3.10", "3.11"], reuse_venv=True)
def test(session):
_install(session)
session.run(
"pytest",
"tests",
*session.posargs,
)