-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathnoxfile.py
More file actions
33 lines (25 loc) · 866 Bytes
/
noxfile.py
File metadata and controls
33 lines (25 loc) · 866 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
import nox
nox.options.reuse_existing_virtualenvs = True
nox.options.sessions = ["lint", "tests"]
SRC = "."
@nox.session(python=["3.12"])
def lint(session):
"""Runs linters and fixers"""
session.run("poetry", "install", external=True)
session.run("poetry", "check", "--lock", "--strict", external=True)
session.run("isort", "--check", SRC)
session.run("black", "--check", SRC)
session.run("flake8", SRC)
session.run("pyright", SRC)
@nox.session(python=["3.12"])
def format(session):
"""Runs linters and fixers"""
session.run("poetry", "install", external=True)
session.run("isort", SRC)
session.run("black", SRC)
session.run("autoflake", SRC)
@nox.session(python=["3.12"])
def tests(session):
"""Runs tests"""
session.run("poetry", "install", external=True)
session.run("pytest", *session.posargs)