-
Notifications
You must be signed in to change notification settings - Fork 1
/
noxfile.py
45 lines (33 loc) · 1.03 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
import nox
PYTHON_VERSIONS = ["3.10", "3.11"]
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = [
"lint",
"pytest",
]
SUB_REPOS = [
"nua-dev",
"nua-build-agent",
# "nua-run",
]
@nox.session(python=PYTHON_VERSIONS)
@nox.parametrize("sub_repo", SUB_REPOS)
def pytest(session: nox.Session, sub_repo: str):
run_subsession(session, sub_repo)
@nox.session
@nox.parametrize("sub_repo", SUB_REPOS)
def lint(session: nox.Session, sub_repo: str):
run_subsession(session, sub_repo)
@nox.session(name="update-deps")
def update_deps(session: nox.Session):
for sub_repo in SUB_REPOS:
with session.chdir(sub_repo):
session.run("poetry", "install", external=True)
session.run("poetry", "update", external=True)
print()
def run_subsession(session, sub_repo):
name = session.name.split("(")[0]
print(f"\nRunning session: {session.name} in subrepo: {sub_repo}\n")
with session.chdir(sub_repo):
session.run("nox", "-e", name, external=True)
print()