refactor: drop the empty all extra from generated projects - #263
Conversation
The `all` optional-dependency was permanently empty — every component's runtime deps live in core `dependencies` — yet `<pkg>[all]` was still wired into the dev group, six tox envs, and four docs workflows, installing nothing. Three documents cited it as load-bearing (the `style` env comment, ADR-006's autodoc rationale, ADR-008's eager-broker-import rationale); all three now attribute dependency availability to core `dependencies`. Adds ADR-028.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (13)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe change removes the empty ChangesGenerated dependency model
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change removes an empty generated dependency extra and updates the related templates, workflows, tests, and documentation; no actionable merge-blocking risk remains after normal checks and review. Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR removes the permanently-empty all extra from generated projects and updates surrounding tooling/docs to reflect that runnable component dependencies are already installed via core [project] dependencies.
Changes:
- Dropped
[project.optional-dependencies]entirely from the generatedpyproject.toml(removing the emptyall = []extra) and removed the{{pkg}}[all]self-reference from thedevdependency group. - Removed
extras = ["all"]from tox envs and removed--extra allfrom docs-related GitHub Actions workflow commands. - Updated ADRs and tests to assert that optional dependencies are not present and to document the rationale/impact (new ADR-028).
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_golden_files/pyproject_library.toml | Updates golden rendered pyproject.toml to remove the empty all extra and related tox/dev wiring. |
| tests/test_golden_files/pyproject_full.toml | Same as above for the full preset golden file, including integration env removal of extras = ["all"]. |
| tests/test_entrypoints.py | Updates assertions to require absence of optional-dependencies in rendered projects. |
| template/pyproject.toml.jinja | Removes [project.optional-dependencies] and the {{github_repo_name}}[all] dev-group entry; drops tox extras = ["all"] settings. |
| template/.github/workflows/release.yml.jinja | Removes --extra all from docs build invocation in the release workflow. |
| template/.github/workflows/{% if include_docs %}gh-pages.yml{% endif %} | Removes --extra all from the manual GH Pages build workflow. |
| template/.github/workflows/{% if include_docs %}docs-preview.yml{% endif %} | Removes --extra all from PR docs preview build commands. |
| template/.github/workflows/{% if include_docs %}docs-linkcheck.yml{% endif %} | Removes --extra all from docs linkcheck workflow command. |
| docs/adr/028-no-empty-all-extra.md | Adds ADR-028 documenting the decision, rationale, and adopter-facing consequence. |
| docs/adr/008-worker-broker-testing-strategy.md | Corrects ADR text to attribute broker driver availability to core dependencies (not extras). |
| docs/adr/006-sphinx-shibuya-for-documentation.md | Corrects ADR text to describe docs builds as installing the project and its runtime deps (not extras). |
| CLAUDE.md | Updates “Adding New Optional Components” guidance to reflect “no optional-dependencies” posture (ADR-028). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Removing the extra and the dev-group self-reference changes the project metadata `uv.lock` records, so an adopter's committed lockfile goes stale when the copier-update PR lands and every `uv run --locked` call fails until someone re-locks. Documents this in ADR-028 and, generally, in the maintainer setup guide's copier-update section.
|
Addressed the review's re-lock finding in 2c10c2d:
Re-verified on a fresh full-preset render: |
What
Generated projects no longer declare
[project.optional-dependencies]at all.The
allextra was permanently empty — every runnable component's runtimedependency lives in the core
dependencieslist, because__main__imports theprimary component unconditionally. But the surrounding wiring survived:
all = []plus a three-line comment justifying its emptiness<pkg>[all]in thedevdependency groupextras = ["all"]on six tox envs (test,style,docs-build,docs-server,docs-linkcheck,integration)uv run --no-default-groups --extra all --group docs …in four docs workflowsNone of it installed a single package.
Why now
It wasn't merely inert — three places cited it as load-bearing and were wrong:
styleenv comment claimed optional components "are only importable when their extra is installed"extras = ["all"]would break.. automodule:: pkg.web.appextras = ["all"](so the driver is always present)"All three now attribute dependency availability to core
dependencies, which iswhat actually supplies it. Since the ADRs needed correcting either way, keeping
the extra as a future "seam" stopped paying for itself.
Adds ADR-028 recording the decision and the one outward-facing consequence:
an adopter who hand-added
uv run --extra allmust drop the flag oncopier update.Verification
mise run test— 118/118 pass (3 assertions intest_entrypoints.pyupdated; both golden files regenerated)uv syncresolves,tox -e styleOK (mypy/pylint/basedpyright see every component without the extra),tox -e 3.1466 passed,tox -e docs-buildOK (autodoc imports fastapi/textual/mcp/faststream fine)--all-extrasin the SBOM/pip-audit export is left alone — it's alreadydocumented as a harmless safeguard and stays valid with no extras defined.