-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
31 lines (21 loc) · 765 Bytes
/
noxfile.py
File metadata and controls
31 lines (21 loc) · 765 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
"""Automation tasks for linting, typing, and testing."""
from __future__ import annotations
import nox
nox.options.sessions = ["lint", "typecheck", "tests"]
def _install_project(session: nox.Session) -> None:
session.install(".")
@nox.session
def lint(session: nox.Session) -> None:
session.install("ruff")
session.run("ruff", "format", "--check", "src", "tests")
session.run("ruff", "check", "src", "tests")
@nox.session
def typecheck(session: nox.Session) -> None:
_install_project(session)
session.install("mypy", "types-requests", "types-python-dateutil")
session.run("mypy", "src")
@nox.session
def tests(session: nox.Session) -> None:
_install_project(session)
session.install("pytest")
session.run("pytest")