-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
44 lines (34 loc) · 982 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
37
38
39
40
41
42
43
44
import nox
nox.options.sessions = ["lint"]
PYTHON_SOURCES = ["app", "noxfile.py", "database-setup.py"]
@nox.session
def test(session):
"""
Run the test suite
"""
session.install("-r", "app/requirements.txt")
session.run("python", "app/manage.py", "test", "app/", "--noinput")
@nox.session
def lint(session):
"""
Lint all python code
"""
session.install("black", "flake8", "isort")
session.run("black", "--check", *PYTHON_SOURCES)
session.run("flake8", *PYTHON_SOURCES)
session.run("isort", "--check", *PYTHON_SOURCES)
@nox.session(name="format")
def format_(session):
"""
Format and sort all imports in python code
"""
session.install("black", "isort")
session.run("black", *PYTHON_SOURCES)
session.run("isort", *PYTHON_SOURCES)
@nox.session
def check_push(session):
"""
Check all is ready for pushing to git
"""
session.run("npm", "run", "lint-all", external=True)
test(session)