forked from ryan-aoi/rapidhash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
45 lines (33 loc) · 924 Bytes
/
noxfile.py
File metadata and controls
45 lines (33 loc) · 924 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
43
44
45
import nox
@nox.session(tags=["test"])
def tests(session):
session.install(".", "pytest", "numpy", "scipy")
session.run("pytest")
@nox.session(tags=["ci"])
def lint(session, fix=False, unsafe=False):
session.install("ruff")
command = ["ruff", "check"]
if fix:
command.append("--fix")
if unsafe:
command.append("--unsafe-fix")
session.run(*command, ".")
@nox.session
def fmt(session, unsafe=False):
session.install("ruff")
command = ["ruff", "format"]
if unsafe:
command.append("--unsafe-fix")
session.run(*command, ".")
@nox.session(tags=["ci"])
def typecheck(session):
session.install("pyright")
session.run("pyright")
@nox.session
def docs(session):
session.install("mkdocs-material")
session.run("mkdocs", "build")
@nox.session
def prepare(session):
session.install("pre-commit")
session.run("pre-commit", "install")