-
Notifications
You must be signed in to change notification settings - Fork 3
/
noxfile.py
45 lines (35 loc) · 1.06 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
import nox
nox.options.sessions = ["lint"]
SOURCES = [
"docs",
"dash_loading_spinners/__init__.py",
"examples/usage.py",
"noxfile.py",
"setup.py",
"tasks.py",
]
@nox.session()
def lint(session):
session.install("black", "flake8", "isort")
session.run("black", "--check", *SOURCES)
session.run("flake8", *SOURCES)
session.run("isort", "--check", *SOURCES)
@nox.session(name="format")
def format_(session):
session.install("black", "isort")
session.run("black", *SOURCES)
session.run("isort", *SOURCES)
@nox.session(python=["3.7", "3.8", "3.9", "3.10"])
def test(session):
session.install("pytest")
session.install("-r", "tests/requirements.txt")
session.install(".")
session.run("pytest", "--headless", "tests")
@nox.session(name="build")
def build(session):
session.install(".", "build", "dash[dev]", "invoke", "semver")
session.run("invoke", "clean")
session.run("npm", "run", "build", external=True)
session.run(
"python", "-m", "build", "--sdist", "--wheel", "--outdir", "dist/"
)