-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
42 lines (29 loc) · 893 Bytes
/
Copy pathnoxfile.py
File metadata and controls
42 lines (29 loc) · 893 Bytes
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
import nox
REQUIRES = {
"bake": ["cookiecutter>=1.6.0,<2.0.0"],
"test": ["cookiecutter>=1.6.0,<2.0.0", "nox"],
"fmt": ["black>=19.10b0,<20.00"],
"lint": ["flake8>=3.7.9,<4.0.0"],
}
def install(session, *names):
for e in names:
session.install(*REQUIRES[e])
@nox.session
def devel(session):
install(session, "bake", "test", "fmt", "lint")
@nox.session
def bake(session):
install(session, "bake")
session.run("cookiecutter", "--no-input", "--overwrite-if-exists", ".")
@nox.session
def test(session):
install(session, "test")
session.run("python", "-m", "unittest", "discover", "tests")
@nox.session
def fmt(session):
install(session, "fmt")
session.run("black", "-l", "79", "hooks", "tests", "noxfile.py")
@nox.session
def lint(session):
install(session, "lint")
session.run("flake8", "hooks", "tests", "noxfile.py")