Skip to content

feat(image): allow overriding the mkProjectShell python interpreter - #1048

Merged
c-vigo merged 3 commits into
devfrom
feature/1038-mkprojectshell-python-override
Jul 14, 2026
Merged

c-vigo merged 3 commits into
devfrom
feature/1038-mkprojectshell-python-override

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Implements #1038 — the ABI-alignment knob blocking the cad2gdml onboarding (#1040 Phase 0).

  • mkProjectShell gains python ? pkgs.python314 (same additive pattern as modules/hooks); UV_PYTHON derives from ${python}/bin/${python.executable} instead of the hardcoded python3.14 string, so uv pins whatever interpreter the consumer selects.
  • Second interpreter assumption found and fixed during testing: vig-utils (a devTools entry, built against the devkit's pinned 3.14) propagates its interpreter onto PATH, shadowing an overridden python3. A conditional hook prepends the override's bin to PATH — only when python != pkgs.python314, so the hook is the empty string by default and the zero-argument shell stays byte-identical (drvPath parity test added alongside the override test).
  • Deliberately left: the image-build path's own python314 pins — the published image is devkit's toolchain, not consumer-overridable; the issue scopes to the dev-shell builder.
  • No FreeCAD-import test: pulling FreeCAD is far too heavy for CI. The FreeCAD acceptance case is exercised by the cad2gdml onboarding spike ([EPIC] Onboard exoma-ch/cad2gdml as first external devkit consumer (direnv mode) #1040 Phase 0); Python 3.13 (the reliably-cached nixpkgs default) stands in as the ABI probe here.
  • Documented in docs/MIGRATION.md with the issue's FreeCAD snippet (mkProjectShell { python = pkgs.python313; extraPackages = [ pkgs.freecad ]; }).

TDD: failing-test commit (RED: unexpected argument 'python') → implementation → docs.

Test evidence

  • uv run pytest tests/test_flake_devshell.py tests/test_flake_modules.py → 21 passed, 1 skipped (NixOS-only test on an FHS host)
  • New: default-drvPath parity with explicit python = pkgs.python314, and override test asserting UV_PYTHON → store python3.13 + python3 --version reports 3.13
  • prek run --all-files → green (re-verified independently before push)

Closes #1038
Refs: #1040

@c-vigo
c-vigo merged commit e4853bd into dev Jul 14, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/1038-mkprojectshell-python-override branch July 14, 2026 09:34
c-vigo added a commit that referenced this pull request Jul 14, 2026
## Summary

Implements #1039 via the issue's recommended Option 1 — a runtime guard,
so the scaffold stays uniform and a repo later flipped public starts
scanning automatically with no re-scaffold.

- Job-level `if: ${{ !github.event.repository.private }}` on
`codeql.yml`'s `analyze` and `scorecard.yml`'s `analysis` jobs. Private
repos get skipped (neutral) runs instead of two permanently red
workflows (CodeQL needs GHAS — unavailable on Free-plan private repos;
Scorecard is public-only).
- Both files are manifest-synced: the guard lands in the root SSoT
copies (a no-op for the public devkit) and the scaffold copies are
regenerated byte-identical.
- Trigger-payload correctness researched explicitly:
`github.event.repository.private` is populated on `pull_request`,
`push`, and — since GitHub's 2022-09-27 change adding repository info to
scheduled-run payloads — `schedule`, covering every trigger both
workflows declare. Reasoning recorded in each workflow header.
- Documented in `docs/MIGRATION.md` at the existing codeql/scorecard
description.

Unblocks the second cad2gdml Phase-0 prerequisite (#1040); the last one
(#1038) merged in #1048.

TDD: new `tests/test_workflow_private_repo_guard.py` (YAML-parses all 4
copies, asserts the job guard) — RED 4 failed → GREEN 4 passed.

## Test evidence
- `uv run pytest tests/test_workflow_private_repo_guard.py` → 4 passed
- `actionlint` clean on all 4 workflow files
- `prek run --all-files` → green (re-verified independently before push)

Closes #1039
Refs: #1040
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