← ClaudeAtlas

sync-depslisted

Synchronises all dependency files from the actual imports in the codebase. Use when asked to "update requirements.txt", "sync dependencies", "update pyproject.toml dependencies", "fix requirements", "update deps", "sync deps", "update dependency files", or "update renv/environment.yml". Scans all Python source files for third-party imports, resolves PyPI package names, fetches installed versions, then writes requirements.txt and updates pyproject.toml [project.dependencies] — keeping every dep file in sync with a single source of truth.
laceto/financialtools · ★ 1 · Data & Documents · score 55
Install: claude install-skill laceto/financialtools
# Sync Dependencies Derives the project's dependency list from **actual imports in source files** — one scan, one canonical list, propagated to every dep file. No manual bookkeeping; no drift between `requirements.txt` and `pyproject.toml`. ## When to Use This Skill - User says "update requirements.txt", "sync deps", "fix requirements", "update deps" - User says "update pyproject.toml dependencies", "sync dependency files" - After adding or removing a package to the project - Before a release or a code review --- ## Single Source of Truth ``` source files (.py, .ipynb) │ ▼ sync_deps.py ← ONE scan, ONE canonical list │ ├──▶ requirements.txt ├──▶ pyproject.toml [project.dependencies] ├──▶ environment.yml (if present) └──▶ setup.cfg (if present) ``` Everything is derived; never edit dep files by hand. --- ## Step 1 — Run the scanner Run the bundled script from the **repo root** (not from inside the skill folder): ```bash python .claude/skills/sync-deps/scripts/sync_deps.py ``` The script outputs one `package>=X.Y` line per third-party dependency, sorted alphabetically, to **stdout**. Capture it: ```bash python .claude/skills/sync-deps/scripts/sync_deps.py > /tmp/deps_raw.txt ``` Inspect the output before writing anything. If a package is missing or wrong, update `IMPORT_TO_PACKAGE` in the script — that is the only place to change. --- ## Step 2 — Write `requirements.txt` Replace the full con