Skip to content

Commit 8431d66

Browse files
committed
chore(deps): update validation dependencies and add package checks in tests
1 parent bdfa5d9 commit 8431d66

4 files changed

Lines changed: 364 additions & 17 deletions

File tree

bun.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ dev = [
4242
# skill code samples actually resolves against the installed version.
4343
# CI installs this group on every run; local dev opts in.
4444
validation = [
45-
"advanced-alchemy[cli,cryptography]>=1.11.0",
45+
"advanced-alchemy[cli,cryptography,fsspec,obstore]>=1.11.0",
4646
"argon2-cffi>=23.1", # advanced_alchemy.types.password_hash.argon2 imports argon2 at module load
4747
"dishka>=1.4",
4848
"flask>=3.0", # advanced_alchemy.extensions.flask imports flask at module load
@@ -56,11 +56,11 @@ validation = [
5656
"litestar-saq[psycopg]>=0.8.0",
5757
"litestar-vite>=0.27.0",
5858
"msgspec>=0.21.1",
59-
"polyfactory[sqlalchemy]>=3.3.0",
59+
"polyfactory[beanie,sqlalchemy]>=3.3.0",
6060
"pytest-databases>=0.19.0",
6161
"sanic[ext]>=24.6", # advanced_alchemy.extensions.sanic imports sanic_ext at module load
6262
"sqlmodel>=0.0.27",
63-
"sqlspec[adk,asyncpg,performance,psycopg]>=0.56.0",
63+
"sqlspec[adk,asyncpg,duckdb,oracledb,performance,psycopg]>=0.56.0",
6464
]
6565

6666
[project.urls]
@@ -142,6 +142,13 @@ markers = [
142142
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
143143
"integration: marks tests as integration tests",
144144
]
145+
# Silence deprecations from transitive tooling deps we neither control nor give
146+
# guidance on. Scoped by message so real deprecations from the libraries the
147+
# skills document (litestar, advanced-alchemy, sqlspec, msgspec, …) still surface.
148+
filterwarnings = [
149+
"ignore:'MultiCommand' is deprecated:DeprecationWarning", # rich_click -> click 9 shim
150+
"ignore:SelectableGroups dict interface is deprecated:DeprecationWarning", # opentelemetry importlib.metadata
151+
]
145152

146153
# ============================================================
147154
# Coverage
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
"""Skip upstream contract modules when their package isn't installed.
2+
3+
The cross-platform ``test`` job installs only the ``dev`` extra, so the upstream
4+
libraries these contracts import are absent there. The contracts run in the jobs
5+
that install the ``validation`` extra (``make check`` and the upstream workflow).
6+
7+
A module is ignored only when its base package is missing entirely — when the
8+
package is installed but an audited symbol has moved, the import still fails and
9+
the contract reports the drift, which is the whole point of the suite.
10+
"""
11+
12+
import importlib.util
13+
14+
# Each contract module imports one upstream package at load time. Map the module
15+
# to that package so collection can be skipped when the package is unavailable.
16+
_MODULE_PACKAGES: dict[str, str] = {
17+
"test_advanced_alchemy": "advanced_alchemy",
18+
"test_litestar": "litestar",
19+
"test_litestar_autowire": "litestar_autowire",
20+
"test_litestar_email": "litestar_email",
21+
"test_litestar_granian": "litestar_granian",
22+
"test_litestar_htmx": "litestar_htmx",
23+
"test_litestar_mcp": "litestar_mcp",
24+
"test_litestar_queues": "litestar_queues",
25+
"test_litestar_saq": "litestar_saq",
26+
"test_litestar_vite": "litestar_vite",
27+
"test_msgspec": "msgspec",
28+
"test_polyfactory": "polyfactory",
29+
"test_pytest_databases": "pytest_databases",
30+
"test_sqlspec": "sqlspec",
31+
}
32+
33+
34+
def _is_installed(package: str) -> bool:
35+
try:
36+
return importlib.util.find_spec(package) is not None
37+
except ModuleNotFoundError:
38+
return False
39+
40+
41+
collect_ignore: list[str] = [
42+
f"{module}.py" for module, package in _MODULE_PACKAGES.items() if not _is_installed(package)
43+
]

0 commit comments

Comments
 (0)