-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathnoxfile.py
More file actions
28 lines (22 loc) · 1.02 KB
/
noxfile.py
File metadata and controls
28 lines (22 loc) · 1.02 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
import nox
# SQLAlchemy 2.0.35+ is required for Python 3.13+
# Older versions fail with symbol errors on 3.13+
SQLA_VERSIONS = {
"3.10": ["2.0.46", "2.0.30", "2.0.10", "1.4.54"],
"3.11": ["2.0.46", "2.0.30", "2.0.10", "1.4.54"],
"3.12": ["2.0.46", "2.0.30", "2.0.10", "1.4.54"],
"3.13": ["2.0.46"], # Only 2.0.35+ supports Python 3.13
"3.14": ["2.0.46"], # Only 2.0.35+ supports Python 3.14
}
@nox.session(python=list(SQLA_VERSIONS.keys()))
def tests(session):
"""Run tests with SQLAlchemy versions compatible with the Python version."""
python_version = f"{session.python.split('.')[0]}.{session.python.split('.')[1]}"
sqla_versions = SQLA_VERSIONS.get(python_version, ["2.0.46"])
# Pin versions to match pyproject.toml for reproducibility
session.install("pytest>=8.3.4")
session.install("syrupy>=4.8.0")
session.install("psycopg2-binary>=2.9.0")
for sqla_version in sqla_versions:
session.install(f"SQLAlchemy=={sqla_version}")
session.run("pytest", "-v", "--tb=short")