Repository navigation
feat: [tool.sdlc] project, for a repo whose Python is in a subdirectory - #15
Merged
Merged
Conversation
…tory The launcher resolved every check against the mount root, so a repo holding its Python project one directory down could not be gated at all. `need_project` found the root pyproject.toml, `uv sync` ran where there was no lockfile, and the gate exited 2 while the code it was meant to check sat untouched below. `project = "image-server"` in the ROOT pyproject.toml moves the uv-driven checks -- mypy, pytest, pip-audit and the sync they share -- into that directory. Everything repo-wide stays at the root: the constitution validator, Gourmand, Gatehouse, CodeQL, and `ruff check .`, whose config is hierarchical and already applies a nested pyproject.toml to the files beneath it. Design decisions worth stating: - **The root pyproject, not an env var or a CI argument.** The pre-commit hook, the pre-push hook and the CI job all read that file, and all three must agree on where the project is. Three entry points means three places to forget. - **Validated when the config is read**, not when a check runs: relative, inside the repo, and holding a pyproject.toml. `sdlc_config()` already calls into the whole config on every command, so a bad value fails on the next commit rather than in CI. Seven tests in tests/test_plan.py cover the refusals and the default. - **The venv cache key includes the subdirectory.** One repo can hold two projects, and gates.sh already recorded what happens when two projects share a UV_PROJECT_ENVIRONMENT: uv rebuilds the venv on every invocation, in both directions, forever. - **A single string, not a list.** No repo needs two projects yet, and a list is a later change if one does. - **Default `"."`**, so nothing changes for the 26 repos already converted. `run()` gains a `cwd` parameter for this, defaulting to the repo root, and the five uv call sites pass the project directory. Nothing else moved. Prompted by crunchtools/rotv, the last repo in the RT#1552 conversion: a Node.js project whose `image-server/` is a deployed Python service with 19 modules, `strict = true` declared but never run, and six test files that no workflow has ever executed. The alternative was promoting image-server's config to the root, which the constitution's own `version_files` glob would then force to share rotv's release version, or declaring rotv exempt and leaving that service ungated. Neither is worth avoiding a six-line resolver. RT#1552 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Y1jesjfgxHeqtKJCvay6
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.
The launcher resolved every check against the mount root, so a repo holding its
Python project one directory down could not be gated at all.
need_projectfound the root pyproject.toml,
uv syncran where there was no lockfile, andthe gate exited 2 while the code it was meant to check sat untouched below.
project = "image-server"in the ROOT pyproject.toml moves the uv-drivenchecks -- mypy, pytest, pip-audit and the sync they share -- into that
directory. Everything repo-wide stays at the root: the constitution validator,
Gourmand, Gatehouse, CodeQL, and
ruff check ., whose config is hierarchicaland already applies a nested pyproject.toml to the files beneath it.
Design decisions worth stating:
the pre-push hook and the CI job all read that file, and all three must agree
on where the project is. Three entry points means three places to forget.
the repo, and holding a pyproject.toml.
sdlc_config()already calls intothe whole config on every command, so a bad value fails on the next commit
rather than in CI. Seven tests in tests/test_plan.py cover the refusals and
the default.
projects, and gates.sh already recorded what happens when two projects share
a UV_PROJECT_ENVIRONMENT: uv rebuilds the venv on every invocation, in both
directions, forever.
a later change if one does.
".", so nothing changes for the 26 repos already converted.run()gains acwdparameter for this, defaulting to the repo root, and thefive uv call sites pass the project directory. Nothing else moved.
Prompted by crunchtools/rotv, the last repo in the RT#1552 conversion: a
Node.js project whose
image-server/is a deployed Python service with 19modules,
strict = truedeclared but never run, and six test files that noworkflow has ever executed. The alternative was promoting image-server's config
to the root, which the constitution's own
version_filesglob would then forceto share rotv's release version, or declaring rotv exempt and leaving that
service ungated. Neither is worth avoiding a six-line resolver.
RT#1552
🤖 Generated with Claude Code
https://claude.ai/code/session_01R7Y1jesjfgxHeqtKJCvay6