Skip to content

Commit a9398ec

Browse files
committed
fix: silence deptry DEP001 for optional tests.* import
caldav/config.py optionally imports tests.test_servers.registry to auto-start a test server when run from a source checkout, falling back gracefully via ImportError otherwise. deptry's isolated CI install doesn't ship tests/, so it flagged the import as missing, which was also breaking this PR's deptry check independently of its own change. Prompt: Add fix as another commit onto PR 716, after all the purpose of PR 716 is to get the tests green again Assisted-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 3a0d83a commit a9398ec

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎pyproject.toml‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,12 @@ test = [
130130
ignore = ["DEP002"] # Test dependencies (pytest, coverage, etc.) are not imported in main code
131131

132132
[tool.deptry.per_rule_ignores]
133-
DEP001 = ["conf", "h2"] # conf: Local test config, h2: Optional HTTP/2 support.
133+
DEP001 = ["conf", "h2", "tests"] # conf: Local test config, h2: Optional HTTP/2 support.
134134
## httpxyz needed an entry here while it was imported by name; the httpx-family
135135
## libraries are now imported dynamically (see _ASYNC_HTTPX_CANDIDATES), which
136136
## deptry does not see at all.
137+
## tests: caldav/config.py optionally imports tests.test_servers.registry (source
138+
## tree only, guarded by ImportError) to auto-start a test server from a checkout.
137139
DEP003 = ["aiohttp", "h2"] # aiohttp: optional dep used only in caldav/testing.py
138140
## h2 needs an entry in both DEP001 and DEP003: which of the two the optional
139141
## `import h2` in async_davclient.py trips depends on whether h2 happens to be

0 commit comments

Comments
 (0)