Skip to content

feat(workspace): language-neutral scaffold + opt-in Python flake template - #933

Merged
c-vigo merged 8 commits into
devfrom
feature/929-language-neutral-scaffold
Jul 8, 2026
Merged

c-vigo merged 8 commits into
devfrom
feature/929-language-neutral-scaffold

Conversation

@c-vigo

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

Copy link
Copy Markdown
Contributor

Summary

Makes the copied project scaffold language-neutral and ships Python as an
opt-in flake template. Historically every consumer inherited a Python
package starter (pyproject.toml, src/template_project/, tests/) plus a
uv/ruff/pytest CI contract — wrong for the many non-Python repos (Rust, TS
actions, data mirrors), whose CI even failed on adoption (just test →
uv run pytest exits 5 with no project).

Closes #929
Closes #930

What changed

Language-neutral scaffold (#929)

  • Deleted the Python package starter from assets/workspace/ (pyproject.toml,
    src/template_project/, tests/).
  • Guarded lint/format/test/test-cov in justfile.project on
    pyproject.toml (mirroring the existing sync guard), so just sync|precommit|test
    and both CI contracts stay green on a repo with no Python.
  • Removed the now-dead src/template_project rename + test-import rewrite from
    init-workspace.sh; pyproject.toml stays in PRESERVE_FILES, so a consumer
    that brings its own is never clobbered.
  • Updated bats + image tests, MIGRATION.md, the README template, manifest.toml
    (documents that Python files are intentionally never synced), and CHANGELOG.md.

Opt-in Python starter (#930)

  • New templates/python/ (concrete example_pkg, minimal pytest dev group),
    registered as templates.python. Restore a Python layout on demand with
    nix flake init -t github:vig-os/devcontainer#python.

Why one PR

#929 and #930 must ship together (removal + restore path), so they are bundled
here; each commit carries its own Refs:.

Verification (local, all green)

  • bats: 112/112.
  • Non-Python CI proof: every guarded recipe + just sync && just test exit 0
    with no pyproject.toml.
  • Template smoke: nix flake init -t .#python → rename example_pkg →
    uv sync + pytest → 1 passed.
  • nix flake check --no-build: all checks pass (validates templates.python).
  • Full prek run --all-files: green.
  • Image-dependent pytest (test_install_script.py, test_image.py,
    test_integration.py) edited + syntax/lint-clean; exercised by the
    test-integration CI job.

c-vigo added 5 commits July 8, 2026 14:34
Assert the copied scaffold ships no pyproject.toml/src/tests and that
init-workspace.sh no longer renames a template Python package. Adjust the
manifest-upgrade and bare-mode assertions to a language-neutral survival
marker (justfile.project) instead of the renamed src/<name> package.

Refs: #929
Drop the shipped Python package starter (pyproject.toml, src/template_project/,
tests/) so a non-Python consumer no longer inherits a package layout it must
delete. Guard the Python task recipes (lint/format/test/test-cov) behind a
pyproject.toml check, mirroring the existing sync guard, so `just sync|test`
and both CI contracts stay green on a repo with no Python. Remove the
now-dead src/template_project rename and test-import rewrite from
init-workspace.sh; pyproject.toml stays in PRESERVE_FILES so a consumer's own
manifest is never clobbered.

Python becomes opt-in via a flake template (see #930).

Refs: #929
Flip test_install_creates_pyproject to assert no pyproject.toml is scaffolded;
repoint the SHORT_NAME-derivation and placeholder-manifest checks at
justfile.project (still placeholder-bearing). Drop test_project_installed_after_init:
with no scaffold pyproject, init no longer produces a uv.lock, so its premise
no longer holds.

Refs: #929
Record the removal of the shipped Python starter and the guarded recipes in
the changelog (Changed + Removed), reframe the MIGRATION Python note as
image-provides / scaffold-opt-in, drop pyproject from the bare-mode file list,
add a README note, and mark in manifest.toml that the Python package files are
intentionally never synced into the scaffold.

Refs: #929
…thon)

Add templates/python/ (pyproject + src/ + tests/) and register it as
templates.python so a consumer can restore a Python package layout onto the
now language-neutral scaffold with `nix flake init -t github:vig-os/devcontainer#python`.
The template uses a concrete example_pkg name the user renames — `nix flake init`
does no placeholder substitution — and ships a minimal pytest dev group.
Covered by tests/test_flake_checks.py::test_python_template_is_exposed.

Refs: #930
@c-vigo c-vigo added feature New feature or request semver:minor New feature, backward-compatible area:workspace Workspace tooling, justfile, templates labels Jul 8, 2026
@c-vigo c-vigo added this to the 0.5 milestone Jul 8, 2026
c-vigo added 3 commits July 8, 2026 15:37
test_just_test_recipe asserted pytest actually ran ("test session starts"),
which no longer holds now the scaffold ships no pyproject.toml: the guarded
recipe no-ops and exits 0. Assert that contract instead — exit 0 with no
pytest session — matching the shipped ci.yml and the release smoke-test
dispatch, which gate on `just test`'s exit code (green on a base project).

Refs: #929
test_install_creates_src_directory / _tests_directory asserted the installed
workspace has a Python package layout; the language-neutral scaffold ships
neither. Flip both to assert absence, matching the dropped pyproject.toml.

Refs: #929
@c-vigo
c-vigo merged commit bcb0863 into dev Jul 8, 2026
15 checks passed
@c-vigo
c-vigo deleted the feature/929-language-neutral-scaffold branch July 8, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:workspace Workspace tooling, justfile, templates feature New feature or request semver:minor New feature, backward-compatible

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant