-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnoxfile.py
44 lines (34 loc) · 1.01 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
"""
Runs tests and other routines.
Usage:
1. Install "nox"
2. Run "nox" or "nox -s test"
"""
import os
import nox
def _install_local_deps(session):
"""Install local dc3 dependencies."""
for path in ["../dc3_pyhidra_github", "../dc3_dragodis_github"]:
if os.path.exists(path):
session.install(path)
@nox.session(python="3.11")
def test(session):
"""Run pytests"""
_install_local_deps(session)
session.install("-e", ".[testing]")
session.run("pytest")
@nox.session(python="3.11")
def build(session):
"""Build source and wheel distribution"""
session.run("python", "setup.py", "sdist")
session.run("python", "setup.py", "bdist_wheel")
@nox.session(python=False)
def release_patch(session):
"""Generate release patch"""
session.run("mkdir", "-p", "dist", external=True)
with open("./dist/updates.patch", "w") as out:
session.run(
"git", "format-patch", "--stdout", "main",
external=True,
stdout=out
)