forked from dod-cyber-crime-center/pyhidra
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathnoxfile.py
36 lines (28 loc) · 783 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
"""
Runs tests and other routines.
Usage:
1. Install "nox"
2. Run "nox" or "nox -s test"
"""
import nox
from pathlib import Path
@nox.session(python="3.7")
def test(session):
"""Run pytests"""
session.install("-e", ".[testing]")
session.run("pytest")
@nox.session(python="3.7")
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"""
Path("dist").mkdir(exist_ok=True)
with open("./dist/updates.patch", "w") as out:
session.run(
"git", "format-patch", "--stdout", "master",
external=True,
stdout=out
)