From da86b66eb289c42af72b2ffd52aab9c83adc5628 Mon Sep 17 00:00:00 2001 From: Juliet Shen Date: Mon, 13 Jul 2026 18:46:41 -0400 Subject: [PATCH] ci(deps): make fawltydeps see member pyprojects, enable undeclared check fawltydeps only read the root pyproject for declared deps, so member-declared runtime deps (flask-cors on osprey_worker, aiodns/pycares on osprey_async_worker) were falsely reported as undeclared. Add the member pyprojects to its `deps`, and ignore the first-party/typing-only imports that remained (example_plugins' flat `udfs`/`async_sinks`/`register_async_plugins`, and `_typeshed`). With those false positives gone, run the full fawltydeps check (unused + undeclared) in CI instead of unused only, so imports that aren't declared can't silently rely on a transitive being present. Refs #157. Co-Authored-By: Claude Opus 4.8 Claude-Session: https://claude.ai/code/session_01TEcfpqhza3dPepZUVWw36X --- .github/workflows/code-quality.yml | 4 ++-- pyproject.toml | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.github/workflows/code-quality.yml b/.github/workflows/code-quality.yml index 08c28b14..e828dd43 100644 --- a/.github/workflows/code-quality.yml +++ b/.github/workflows/code-quality.yml @@ -51,8 +51,8 @@ jobs: uv run pre-commit install --install-hooks uv run pre-commit run --show-diff-on-failure --color=always --all-files - - name: Check for unused dependencies - run: uv tool run fawltydeps --check-unused --pyenv .venv + - name: Check for unused and undeclared dependencies + run: uv tool run fawltydeps --pyenv .venv ui-quality: runs-on: ubuntu-24.04 diff --git a/pyproject.toml b/pyproject.toml index cf10a8b9..754994d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -168,7 +168,24 @@ known-first-party = ["osprey_worker", "osprey_async_worker", "osprey_rpc", "exam [tool.fawltydeps] code = ["osprey_worker/src", "osprey_async_worker/src", "osprey_rpc/src", "example_plugins/src"] -deps = ["pyproject.toml"] +# Include the workspace members so member-declared runtime deps (e.g. flask-cors on +# osprey_worker, aiodns/pycares on osprey_async_worker) aren't reported as undeclared. +deps = [ + "pyproject.toml", + "osprey_rpc/pyproject.toml", + "osprey_worker/pyproject.toml", + "osprey_async_worker/pyproject.toml", + "example_plugins/pyproject.toml", +] +ignore_undeclared = [ + # First-party: example_plugins uses a flat src layout, so these are its own + # top-level packages, not external dependencies. + "async_sinks", + "register_async_plugins", + "udfs", + # Typing-only import guarded by TYPE_CHECKING. + "_typeshed", +] ignore_unused = [ # Type stubs: used by mypy, never imported directly "types-cachetools",