-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnoxfile.py
More file actions
61 lines (44 loc) · 2.01 KB
/
noxfile.py
File metadata and controls
61 lines (44 loc) · 2.01 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
from nox_poetry import Session, session
latest_python_version = "3.11"
old_python_versions = ["3.9", "3.10"]
@session(python=latest_python_version) # type: ignore[misc]
def tests_with_coverage(session: Session) -> None:
args = session.posargs or ["--cov"]
session.run("pip", "install", "cvxpy~=1.3.0")
session.run("poetry", "install", "--no-dev", external=True)
session.install("coverage[toml]", "pytest", "pytest-cov", "pytest-mock")
session.run("pytest", *args)
@session(python=old_python_versions) # type: ignore[misc]
def tests(session: Session) -> None:
args = session.posargs
session.run("pip", "install", "cvxpy~=1.3.0")
session.run("poetry", "install", "--no-dev", external=True)
session.install("pytest", "pytest-mock")
session.run("pytest", *args)
locations = "stratified_models", "noxfile.py"
@session(python=latest_python_version) # type: ignore[misc]
def lint(session: Session) -> None:
args = session.posargs or locations
session.install("flake8")
session.run("flake8", *args)
@session(python=latest_python_version) # type: ignore[misc]
def black(session: Session) -> None:
args = session.posargs or locations
session.install("black")
session.run("black", "--check", "--diff", "--color", *args)
@session(python=latest_python_version) # type: ignore[misc]
def mypy(session: Session) -> None:
args = session.posargs or locations
session.run("pip", "install", "cvxpy~=1.3.0")
session.run("poetry", "install", "--no-dev", external=True)
session.install("mypy", "pytest")
session.run("mypy", "--version")
session.run("mypy", *args)
package = "stratified_models"
# @session(python=latest_python_version) # type: ignore[misc]
# def typeguard(session: Session) -> None:
# args = session.posargs or []
# session.run("pip", "install", "cvxpy~=1.3.0")
# session.run("poetry", "install", "--no-dev", external=True)
# session.install("pytest", "typeguard")
# session.run("pytest", f"--typeguard-packages={package}", *args)