-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
noxfile.py
69 lines (56 loc) · 1.51 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import nox
from nox_poetry import Session, session
nox.options.reuse_existing_virtualenvs = True
nox.options.error_on_external_run = True
PYTHON_VERSIONS = ["3.12", "3.11", "3.10", "3.9", "3.8"]
COMMON_PYTEST_OPTIONS = [
"--cov=.",
"--cov-append",
"--cov-report=xml",
"-n",
"auto",
"--showlocals",
"-vv",
]
@session(python=PYTHON_VERSIONS, name="SQLAlchemy 2.0 Tests", tags=["tests"])
def tests_sqlalchemy_latest(session: Session) -> None:
session.run_always(
"poetry",
"run",
"pip",
"install",
"--upgrade",
"pip",
"setuptools",
"wheel",
external=True,
)
session.run_always("poetry", "install", external=True)
session.run(
"pytest",
*COMMON_PYTEST_OPTIONS,
)
# No need for now to run 1.4 against all 5 python versions.
@session(python="3.11", name="Sqlalchemy 1.4 Tests", tags=["tests"])
def tests_sqlalchemy_1_4(session: Session) -> None:
session.run_always(
"poetry",
"run",
"pip",
"install",
"--upgrade",
"pip",
"setuptools",
"wheel",
external=True,
)
session.run_always("poetry", "install", external=True)
session._session.install("sqlalchemy~=1.4")
session.run(
"pytest",
*COMMON_PYTEST_OPTIONS,
)
@session(name="Mypy", tags=["lint"])
def mypy(session: Session) -> None:
session.run_always("poetry", "install", external=True)
session.run("mypy", "--config-file", "mypy.ini")