Skip to content

chore(py): prune unused dev deps, cap dev tooling, and clear lockfile vulns - #153

Merged
huangjeff5 merged 2 commits into
mainfrom
chore/py-prune-dev-deps
Nov 30, 2026
Merged

huangjeff5 merged 2 commits into
mainfrom
chore/py-prune-dev-deps

Conversation

@huangjeff5

@huangjeff5 huangjeff5 commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Part 1 of 4 in the dependency hygiene stack: #153 -> #154 -> #156 -> #157.

Removes unused workspace dev/lint dependencies, caps dev tooling at the next major, and upgrades audited packages in uv.lock without touching any published packages/*/pyproject.toml bounds.

# --- BEFORE (root pyproject.toml) ---
# 45 dev/lint entries including unused streamlit, jupyter, ipython, litestar, quart, grpcio...
# -> 137 extra locked packages and 167 pip-audit findings across 22 packages

# --- AFTER (root pyproject.toml) ---
# Only tools and sample/test imports CI actually runs, capped at the next major
# -> 2,200+ lines removed from uv.lock; pip-audit down to 3 findings in setuptools (<82 for liccheck)

Main Changes

  • Pruned unused dev and lint packages: Previously, root [dependency-groups] carried 20+ packages nothing in the workspace imports (streamlit, jupyter, ipython, bpython, pypdf, litestar, quart, grpcio, mypy, ...). Removing them drops 137 locked packages and eliminates most transitive Dependabot alerts.
  • Declared direct test and sample imports explicitly: psutil (used by genkit-mcp process tests), numpy (generate_loop_test.py), and python-dotenv (samples/fastapi-bugbot, type-checked by ty) previously only resolved by accident through unrelated dev tools. Declaring them directly keeps tests and type checks reproducible.
  • Capped workspace-only dev tooling at the next major: Dev and lint groups never ship to PyPI, so capping them (pytest>=8.3.4,<10, ruff>=0.9,<1, ...) only stops a blanket uv lock --upgrade from jumping a linter or test runner across a breaking major.
  • Cleared lockfile vulnerabilities and liccheck friction: Upgraded flagged transitive packages in uv.lock, added SPDX "isc" (dnspython>=2.9) to authorized_licenses, and widened certifi from an exact pin to >=2026.1.4 so routine CA bundle updates don't break license checks.

Why this is safe

  • Users install exactly what they did before: The PR touches only the root pyproject.toml (the unpublished workspace project) and uv.lock, and pip/uv never read either when installing from PyPI. I built wheels for all 37 workspace members (16 packages + samples) on main and on this branch and diffed Name, Version, Requires-Python, Requires-Dist and Provides-Extra in every METADATA: identical.
  • Nothing used the removed packages: For each removed dependency, git grep -w over packages/, samples/, tests/, bin/, scripts/, justfile, noxfile.py and .github/ finds no import or invocation. The only hits are an error message mentioning IPython in _aio.py, and fastapi/structlog, which still install through genkit-fastapi and core genkit.
  • Imports that resolved by accident are now declared: psutil, numpy and python-dotenv were only installed because unrelated dev tools pulled them in. They're listed directly, so removing jupyter and friends doesn't quietly break the MCP tests, generate_loop_test.py, or ty on samples/fastapi-bugbot.
  • Caps only gate uv lock --upgrade: Dev and lint groups never ship, so the <N caps can't affect users. They also don't move anything today; every capped tool is already locked below its cap.
  • CI covers the workspace, and I checked the one job it doesn't: Every check passes: tests on 3.10–3.14, pyright, pyrefly, ty, ruff, Security and Compliance (liccheck, pip-audit) and Build Distributions. deploy_docs.yml only runs on push to main, so I ran mkdocs build locally with the reduced dev group: it builds.
  • Re-verified after merging main (0.14.0): uv lock --check passes. Locally: 7900 tests passed, pyright/pyrefly/ty clean, liccheck passes for 109 packages, and pip-audit reports only the 3 known setuptools findings (held below 82 for liccheck).
  • Rollback is one revert: It's a single squashed commit over two files with no published artifact behind it. Reverting restores the old dev environment on the next uv sync.

@huangjeff5
huangjeff5 merged commit a23bfb4 into main Nov 30, 2026
21 checks passed
@huangjeff5
huangjeff5 deleted the chore/py-prune-dev-deps branch November 30, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants