forked from turing-complet/python-ouraring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
48 lines (35 loc) · 1.16 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
nox.options.sessions = "lint", "tests"
locations = ["oura", "tests", "samples", "noxfile.py"]
@nox.session
def tests(session):
args = session.posargs
session.install("pipenv")
session.run("pipenv", "sync", "--dev")
session.run("pipenv", "run", "pytest", *args)
@nox.session
def lint(session):
args = session.posargs or locations
session.install("flake8", "black", "isort")
session.run("flake8", *args)
session.run("black", "--check", "--diff", *args)
session.run("isort", "--profile", "black", "--check", "--diff", *args)
@nox.session
def format(session):
black(session)
isort(session)
def black(session):
args = session.posargs or locations
session.install("black")
session.run("black", *args)
def isort(session):
args = session.posargs or locations
session.install("isort")
session.run("isort", "--profile", "black", *args)
@nox.session
def docs(session):
session.chdir("docs")
session.install("-r", "requirements.txt")
# session.run("sphinx-apidoc", "-f", "-o", "source", "../oura")
# session.run("make", "clean", external=True)
session.run("make", "html", external=True)