-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
noxfile.py
48 lines (39 loc) · 1.37 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
import nox
def confirm(message, validators = ["y", "yes"]):
valid_input = False
while not valid_input:
response = input(message + str(validators).replace(","," or").replace("[","(").replace("]",")").replace("'",""))
if response in validators:
valid_input = True
else:
raise ValueError(f"Failed to confirm; {message}")
@nox.session
def build(session):
# Confirm all the essential release stuff has been done
confirm("Have you run the tests?")
confirm("Have you updated inline docs?")
confirm("Have you updated the wiki docs?")
confirm("Have you created the release page?")
confirm("Have you updated the readme docs?")
# Create source distribution
session.run("python", "setup.py", "sdist")
# Build Documentation
session.install("mkdocs")
session.run("mkdocs", "build")
# Create wheelfile
session.install("wheel")
session.run("python", "setup.py", "bdist_wheel", "--universal")
@nox.session
def release(session):
build(session)
session.install('twine')
session.run("twine", "upload", "dist/*")
@nox.session(python=["3.5", "3.6", "3.7", "3.8"])
def test(session):
session.install('pytest')
session.run('pytest')
@nox.session
def docs(session):
# Serve documentation to verify it's how you want
session.install("mkdocs")
session.run("mkdocs", "serve")