-
Notifications
You must be signed in to change notification settings - Fork 0
/
noxfile.py
34 lines (26 loc) · 1.03 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
""" Nox configuration file for automation of linting and testing.
Adopted and adjusted from https://github.com/mseitzer/pytorch-fid
"""
import nox
LOCATIONS = ("src/", "tests/", "noxfile.py", "setup.py")
@nox.session(python=["3.8", "3.9", "3.10", "3.11", "3.12"])
def tests(session):
session.install("setuptools")
session.install("numpy")
session.install("-r", "requirements.in")
#session.install("numpy") #get numpy's again, but now overwriting requirements.in file to get numpy's latest version based on python version (e.g. python3.12)
session.install(".")
session.install("pytest")
session.install("pytest-mock")
session.run("pytest", *session.posargs)
@nox.session
def lint(session):
session.install("flake8")
session.install("flake8-bugbear")
session.install("flake8-isort")
session.install("black==24.3.0")
session.install("isort")
args = session.posargs or LOCATIONS
session.run("black", "--check", "--diff", *args)
session.run("isort")
session.run("flake8", *args)