Repository navigation
fix(devshell): expose python3 and pre-commit on dev-shell PATH (#729) - #733
Merged
c-vigo merged 4 commits intoJun 29, 2026
Merged
Conversation
mkProjectShell carried neither a bare Python interpreter nor pre-commit, so a downstream flake-input / direnv dev-shell could reach Python only via `uv run` and had no `pre-commit` at all, breaking parity with the image (which ships both via pythonEnv + pre-commit in imageTools). Add the pinned store CPython (python314, reusing the UV_PYTHON binding) and pkgs.pre-commit to the shell's base packages. They stay out of the devTools SSoT because the image already provides them and a bare interpreter there would collide with pythonEnv. Refs: #729
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Downstream consumers of the toolchain via the flake-input / direnv path (
vigos.lib.mkProjectShell,nix develop) got a dev-shell with no barepython/python3and nopre-commiton PATH, even though the OCI image provides all three. Python was reachable only viauv run python. This is a dev-shell ↔ image parity gap.Closes #729.
Root cause
devTools(the toolchain SSoT) deliberately omits a bare interpreter andpre-commit. The dev-shell pinsUV_PYTHONto a Nix-store CPython but puts nothing on PATH.imageToolsadds them separately: apythonEnv(python314.withPackages) andpkgs.pre-commit. So only the image had parity.mkProjectShell(hencedevShells.default) built its package set fromdevToolsalone, so the downstream shell lacked both binaries.Fix
mkProjectShellnow appends the pinned store CPython (python314— the exact interpreterUV_PYTHONalready references, reused for DRY) andpkgs.pre-committo the shell's base packages.Nuance (intentional, explained in the flake comment): these stay out of the
devToolsSSoT. The image already provides them viapythonEnv+pre-commit; adding a barepython314to the SSoT would collide withpythonEnvindockerTools.buildLayeredImage. The project venv remains uv-managed — exposingpython3on PATH does not change uv resolution (which goes throughUV_PYTHON); it just closes the parity gap.Tests (TDD)
Added
test_devshell_exposes_python3_and_precommit(parametrized overpython3andpre-commit) intests/test_flake_devshell.py. It runs undernix develop --ignore-environment --keep HOMEso it asserts the dev-shell's own PATH contribution — a hostpython3/pre-commitleaking through the inherited environment can no longer mask the gap (which is exactly how it hid). Written failing first, then fixed.Verification
pytest tests/test_downstream_flake.py tests/test_flake_devshell.py→ 12 passed, 1 skippednix flake check→ all checks passed (format, devShell build, devShellTools eval)🤖 Generated with Claude Code