Skip to content

refactor(image): drop vestigial baked bandit - #1120

Merged
c-vigo merged 1 commit into
devfrom
feature/1105-drop-baked-bandit
Jul 15, 2026
Merged

c-vigo merged 1 commit into
devfrom
feature/1105-drop-baked-bandit

Conversation

@c-vigo

@c-vigo c-vigo commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes bandit from imageTools. The baked copy was vestigial: the committed
.pre-commit-config.yaml runs uv run bandit (the venv bandit, pinned in
pyproject.toml as bandit[toml]==1.9.4), and the only Nix-bandit consumer is
the sandbox checks.pre-commit profile in nix/hooks.nix — outside the image
closure and untouched here.

nixpkgs builds bandit against CPython 3.13 while the image toolchain is 3.14,
so this one entry dragged in a stray 3.13 package stack (ddt, stevedore, pyyaml,
rich, pygments, gitpython, …) plus a duplicate git-minimal (52 MiB) via
gitpython.

Evidence

  • .#devkitImageEnv closure: −78,095,400 bytes (74.5 MiB)
  • nix path-info -r | grep -E 'python3.13-|git-minimal|bandit' → only
    python3.13-pyflakes remains, anchored solely by actionlint (verified with
    nix why-depends) — that is Evict the redundant CPython 3.13 interpreter: gitMinimal + actionlint without pyflakes (~127 MiB) #1107's target, not part of the bandit stack
  • checks.pre-commit still evaluates (nix eval …pre-commit.drvPath clean);
    uv run bandit --version → bandit 1.9.4, python 3.14.4
  • Baked-bandit test assertions removed (test_bandit_installed,
    EXPECTED_VERSIONS entry) — removal is the intended behavior
  • Full hook suite green (prek run --all-files, exit 0), including the
    surviving venv bandit hook

Part of epic #1103 (sub-issue 2/5). One of the four anchors of the redundant
CPython 3.13 interpreter; the interpreter itself falls in #1107.

Closes #1105

The baked `bandit` in `imageTools` was built by nixpkgs against CPython
3.13 while the image toolchain is 3.14, dragging a stray second Python
package stack (ddt, stevedore, pyyaml, rich, markdown-it-py, mdurl,
pygments, gitpython, gitdb, smmap) plus a full git-minimal (via
gitpython) into the closure — ~74 MiB, unused. The committed hooks run
the venv bandit via `uv run` (pinned `bandit[toml]==1.9.4`); the sandbox
`checks.pre-commit` bandit (nix/hooks.nix) is outside the image closure
and untouched.

Refs: #1105
@c-vigo
c-vigo force-pushed the feature/1105-drop-baked-bandit branch from 7d5feaf to d406a4b Compare July 15, 2026 12:55
@c-vigo
c-vigo enabled auto-merge July 15, 2026 12:56
@c-vigo
c-vigo merged commit 028bebd into dev Jul 15, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/1105-drop-baked-bandit branch July 15, 2026 13:03
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