Skip to content

refactor: drop the empty all extra from generated projects - #263

Merged
hasansezertasan merged 2 commits into
mainfrom
refactor/drop-empty-all-extra
Aug 20, 2026
Merged

refactor: drop the empty all extra from generated projects#263
hasansezertasan merged 2 commits into
mainfrom
refactor/drop-empty-all-extra

Conversation

@hasansezertasan

Copy link
Copy Markdown
Owner

What

Generated projects no longer declare [project.optional-dependencies] at all.

The all extra was permanently empty — every runnable component's runtime
dependency lives in the core dependencies list, because __main__ imports the
primary component unconditionally. But the surrounding wiring survived:

  • all = [] plus a three-line comment justifying its emptiness
  • <pkg>[all] in the dev dependency group
  • extras = ["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 workflows

None of it installed a single package.

Why now

It wasn't merely inert — three places cited it as load-bearing and were wrong:

  • the style env comment claimed optional components "are only importable when their extra is installed"
  • ADR-006 said dropping extras = ["all"] would break .. automodule:: pkg.web.app
  • ADR-008 justified eager broker imports because "every test/tox environment installs extras = ["all"] (so the driver is always present)"

All three now attribute dependency availability to core dependencies, which is
what 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 all must drop the flag on copier update.

Verification

  • mise run test — 118/118 pass (3 assertions in test_entrypoints.py updated; both golden files regenerated)
  • full-preset render: uv sync resolves, tox -e style OK (mypy/pylint/basedpyright see every component without the extra), tox -e 3.14 66 passed, tox -e docs-build OK (autodoc imports fastapi/textual/mcp/faststream fine)

--all-extras in the SBOM/pip-audit export is left alone — it's already
documented as a harmless safeguard and stays valid with no extras defined.

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.
@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: de49b694-31b1-4736-92c4-b86684792b25

📥 Commits

Reviewing files that changed from the base of the PR and between effbf80 and 2c10c2d.

📒 Files selected for processing (13)
  • CLAUDE.md
  • docs/adr/006-sphinx-shibuya-for-documentation.md
  • docs/adr/008-worker-broker-testing-strategy.md
  • docs/adr/028-no-empty-all-extra.md
  • template/.github/workflows/release.yml.jinja
  • template/.github/workflows/{% if include_docs %}docs-linkcheck.yml{% endif %}
  • template/.github/workflows/{% if include_docs %}docs-preview.yml{% endif %}
  • template/.github/workflows/{% if include_docs %}gh-pages.yml{% endif %}
  • template/docs/maintaining/setup.rst.jinja
  • template/pyproject.toml.jinja
  • tests/test_entrypoints.py
  • tests/test_golden_files/pyproject_full.toml
  • tests/test_golden_files/pyproject_library.toml

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change removes the empty all extra from generated projects. Component runtime dependencies remain in core dependencies. Tox environments and documentation workflows no longer install the extra. Tests and golden files verify the updated output.

Changes

Generated dependency model

Layer / File(s) Summary
Dependency policy and ADRs
CLAUDE.md, docs/adr/006-sphinx-shibuya-for-documentation.md, docs/adr/008-worker-broker-testing-strategy.md, docs/adr/028-no-empty-all-extra.md
Guidance and ADRs define component runtime dependencies as core project dependencies and document removal of the all extra.
Project metadata and tox configuration
template/pyproject.toml.jinja
The template removes the empty extra, the development extra reference, and extras = ["all"] from tox environments.
Documentation workflows and maintenance guidance
template/.github/workflows/..., template/docs/maintaining/setup.rst.jinja
Documentation workflows use the docs group without the all extra. Maintenance guidance requires committing uv.lock after dependency metadata changes.
Rendered project expectations
tests/test_entrypoints.py, tests/test_golden_files/*.toml
Tests verify that rendered projects omit the optional-dependencies table and all extra settings.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 2c10c

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)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely identifies the main change: removing the empty all extra from generated projects.
Description check ✅ Passed The description directly explains the removal, rationale, affected files, migration impact, and verification results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 generated pyproject.toml (removing the empty all = [] extra) and removed the {{pkg}}[all] self-reference from the dev dependency group.
  • Removed extras = ["all"] from tox envs and removed --extra all from 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.
@hasansezertasan

hasansezertasan commented Aug 19, 2026

Copy link
Copy Markdown
Owner Author

Addressed the review's re-lock finding in 2c10c2d:

  • ADR-028 Consequences — added the uv.lock staleness hazard: removing the extra + the <pkg>[all] dev entry changes [package.optional-dependencies] / [package.metadata.requires-dev] in the lockfile, so the copier-update PR is red until someone runs uv lock (Renovate's copier manager re-renders but does not re-lock, and CI/prek/mise all use uv run --locked). Dropped the incorrect "only outward-facing change" claim.
  • docs/maintaining/setup.rst — states the re-lock rule for copier updates generally, not just this one, since any template change to dependency metadata has the same effect.
  • ADR-028 accuracy — the six extras sites now name env_run_base (inherited by the per-version test envs and by prek/profile/cli/worker) rather than shorthand "test".
  • pylint C0415 comment — restored the in-component coverage the rewrite dropped (tkinter, textual, uvicorn, the worker's uvloop probe), not just the cli→tui/gui/web dispatch.

Re-verified on a fresh full-preset render: tox -e docs-build,style OK (sphinx-lint clean on the new prose), 118/118 repo tests, prek clean on the range. Golden files regenerated for the comment change.

@hasansezertasan
hasansezertasan merged commit 95c27c1 into main Aug 20, 2026
14 checks passed
@hasansezertasan
hasansezertasan deleted the refactor/drop-empty-all-extra branch August 20, 2026 03:40
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.

2 participants