Skip to content

chore: trim Python deps to what the converters import - #30

Closed
PABannier wants to merge 1 commit into
cleanup/remove-test-apifrom
cleanup/trim-python-deps
Closed

PABannier wants to merge 1 commit into
cleanup/remove-test-apifrom
cleanup/trim-python-deps

Conversation

@PABannier

Copy link
Copy Markdown
Owner

pyproject.toml was the project file for the Python test utilities in tests/: named sam3-cpp-tests, with a hatchling wheel of tests. Once #20 deletes tests/, the tracked Python is just the three convert_*_to_ggml.py scripts (plus scripts/verify_tokenizer.py, removed in #24). Across all tracked .py files, the third-party imports are:

import used by
torch all converters
numpy all converters
yaml convert_sam2_to_ggml.py --config only, imported lazily; wasn't a declared dep before either
regex verify_tokenizer.py, optional with a fallback

Changes:

  • Removed deps: timm, torchvision, Pillow, iopath, einops.
  • Build backend: replaced [build-system]/hatchling with [tool.uv] package = false, since nothing is packaged.
  • Metadata: renamed to sam3-cpp and updated the description.
  • Lock: ran uv lock (−575 lines).

Stacked on #20. Merge #20 first; GitHub will retarget this PR to main.

Verification: in a fresh env, uv run python -c "import torch, numpy" works, and uv run python convert_{sam3,sam2,edgetam}_to_ggml.py --help all run.

git diff --shortstat: 2 files changed, 6 insertions(+), 575 deletions(-).

Part of an over-engineering cleanup series.

🤖 Generated with Claude Code

https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq

pyproject.toml still described the deleted tests/ package (name
"sam3-cpp-tests", hatch wheel of "tests"). It pulled in timm,
torchvision, Pillow, iopath and einops, which no tracked script
imports. The three converters need torch and numpy. Mark the project
non-packaged instead of building a hatchling wheel, then relock.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01M2qLmQ9ag49hT61V6i9qAq
@PABannier PABannier closed this Sep 16, 2026
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.

1 participant