pkg-inventory: scanner script to discover all apt/apk/pypi packages from repo #159

Closed
opened 2026-03-24 03:54:38 +00:00 by kert · 0 comments
Owner

Goal

Create a single script (dev/scripts/pkg_inventory.py) that parses the entire repo and emits a canonical JSON manifest of every package installed across all Dockerfiles, pyproject.toml, uv.lock, CI workflows, and shell scripts.

Scope

  • Parse apt-get install / apk add from all Dockerfiles
  • Parse dependencies and [dependency-groups] from pyproject.toml
  • Parse uv add commands in Dockerfiles (notebooks)
  • Parse CI workflow curl-installed tools (crane, trivy, uv)
  • Output: data/pkg-manifest.json with sections {"apt": [...], "apk": [...], "pypi": [...], "ci_tools": [...]}
  • Must be idempotent and deterministic (sorted, stable output)
  • Include version constraints where declared

Acceptance

  • uv run python dev/scripts/pkg_inventory.py produces data/pkg-manifest.json
  • Output matches manual audit (no missing, no surplus)
  • Script runs in <5s on this repo
## Goal Create a single script (`dev/scripts/pkg_inventory.py`) that parses the entire repo and emits a canonical JSON manifest of every package installed across all Dockerfiles, pyproject.toml, uv.lock, CI workflows, and shell scripts. ## Scope - Parse `apt-get install` / `apk add` from all Dockerfiles - Parse `dependencies` and `[dependency-groups]` from pyproject.toml - Parse `uv add` commands in Dockerfiles (notebooks) - Parse CI workflow curl-installed tools (crane, trivy, uv) - Output: `data/pkg-manifest.json` with sections `{"apt": [...], "apk": [...], "pypi": [...], "ci_tools": [...]}` - Must be idempotent and deterministic (sorted, stable output) - Include version constraints where declared ## Acceptance - [ ] `uv run python dev/scripts/pkg_inventory.py` produces `data/pkg-manifest.json` - [ ] Output matches manual audit (no missing, no surplus) - [ ] Script runs in <5s on this repo
kert added this to the P21: Package Supply Chain — inventory, mirrors, drift, vuln scanning milestone 2026-03-24 03:54:38 +00:00
kert added the cipipeline labels 2026-03-24 03:54:38 +00:00
kert closed this issue 2026-03-24 04:34:59 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: homelab/stack#159