-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoxfile.py
48 lines (37 loc) · 1.07 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
""" nox session definition """
from typing import Any
import nox
locations = "zarr_browser", "noxfile.py"
# https://cjolowicz.github.io/posts/hypermodern-python-02-testing/
# https://cjolowicz.github.io/posts/hypermodern-python-03-linting/
@nox.session(python=None)
def black(session: Any) -> None:
"""runs black to do some automatic code automatisation"""
args = session.posargs or locations
session.install("black")
session.run("black", *args)
@nox.session(python=None)
def lint(session: Any) -> None:
"""runs the linter to inspect the code"""
args = session.posargs or locations
session.install(
"flake8",
# "flake8-bandit",
"flake8-black",
"flake8-bugbear",
"flake8-docstrings",
)
session.run("flake8", *args)
# @nox.session(python=None)
# def tests(session: Any) -> None:
# """runs a test session"""
# session.run(
# "docker",
# "run",
# "--rm",
# "-v",
# f"{os.getcwd()}:/app",
# "zarr_browser:latest",
# "pytest",
# "tests/",
# )