Skip to content

Conversation

@tony
Copy link
Member

@tony tony commented Jan 17, 2026

Summary

  • Add typing_extensions as a runtime dependency for Python <3.11 (fixes import error for NotRequired, TypedDict)
  • Add zero-dependency script to detect undeclared imports in src/
  • Integrate check into CI workflow and justfile

Motivation

Dev-only dependencies like typing_extensions were being used at runtime but not declared in dependencies. This causes import errors when users install the package without dev dependencies.

Implementation

Instead of using external tools like fawltydeps, this adds a minimal ~250 line script using only stdlib (ast, tomllib, sys, pathlib). Benefits:

  • No supply chain risk - zero external dependencies
  • Auditable - simple, self-contained code with doctests
  • Fast - no network calls or package installation

Test plan

  • python .github/scripts/check_deps.py passes
  • python -m doctest .github/scripts/check_deps.py passes (16 tests)
  • uv run pytest passes (297 tests)
  • uv run --no-dev python -c 'from vcspull.types import ConfigDict' works

@codecov
Copy link

codecov bot commented Jan 17, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (master@52dd6ab). Learn more about missing BASE report.

Additional details and impacted files
@@            Coverage Diff            @@
##             master     #498   +/-   ##
=========================================
  Coverage          ?   80.52%           
=========================================
  Files             ?       16           
  Lines             ?     2192           
  Branches          ?      454           
=========================================
  Hits              ?     1765           
  Misses            ?      277           
  Partials          ?      150           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

tony added 4 commits January 18, 2026 12:22
why: NotRequired and TypedDict from typing_extensions are used at runtime
in src/vcspull/types.py but were only available as dev dependencies.
what:
- Add typing_extensions>=4.0.0 with python_version<'3.11' marker
- Python 3.11+ has these in stdlib typing module
why: Detect runtime imports not declared in pyproject.toml dependencies
without relying on external tools (supply chain security).
what:
- Zero-dependency script using only stdlib (ast, tomllib, sys, pathlib)
- Parses pyproject.toml dependencies and extracts imports via AST
- Handles package->import name mapping (PyYAML->yaml, etc.)
- Includes doctests for key functions
why: Catch undeclared imports before they cause runtime failures.
what:
- Add "Check runtime dependencies" step after dependency install
- Runs .github/scripts/check_deps.py to detect undeclared imports
why: Allow local verification of runtime dependencies.
what:
- Add check-deps command in lint group
- Runs .github/scripts/check_deps.py
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