-
Notifications
You must be signed in to change notification settings - Fork 4
/
noxfile.py
57 lines (49 loc) · 1.43 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
52
53
54
55
56
57
import os.path
import nox
@nox.session
def typing_testannex(session: nox.Session) -> None:
session.install("-r", "clients/requirements.txt")
session.install("mypy")
session.run(
"mypy",
"--cache-dir",
str(session.cache_dir / "mypy_cache" / session.name),
"clients/testannex.py",
)
@nox.session
def typing_daily_status(session: nox.Session) -> None:
path = ".github/workflows/tools/daily-status.py"
install_requires(session, path)
session.install("mypy", "types-requests")
session.run(
"mypy",
"--cache-dir",
str(session.cache_dir / "mypy_cache" / session.name),
path,
)
@nox.session
def typing_dispatch_build(session: nox.Session) -> None:
path = ".github/workflows/tools/dispatch-build"
install_requires(session, path)
session.install("mypy")
session.run(
"mypy",
"--cache-dir",
str(session.cache_dir / "mypy_cache" / session.name),
path,
)
def install_requires(session: nox.Session, path: str) -> None:
tmpdir = session.create_tmp()
reqfile = os.path.join(tmpdir, "requirements.txt")
session.install("pip-run")
with open(reqfile, "w", encoding="utf-8") as fp:
session.run(
"python",
"-m",
"pip_run.read-deps",
"--separator",
"newline",
path,
stdout=fp,
)
session.install("-r", reqfile)