Skip to content

Update to python-copier-template 5.2.0 and restructure docs - #248

Merged
gilesknap merged 1 commit into
mainfrom
update-copier-template-5.2.0
Jun 26, 2026
Merged

gilesknap merged 1 commit into
mainfrom
update-copier-template-5.2.0

Conversation

@gilesknap

@gilesknap gilesknap commented Jun 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Updates the project from DiamondLightSource python-copier-template 5.0.2 → 5.2.0 and switches docs_type from README to sphinx (reflecting the project's existing Sphinx docs). The headline change is a docs restructure from the old nested reStructuredText tree to the template's flat MyST-Markdown layout.

Docs restructure

  • Removed the old nested tree: docs/user/*, docs/developer/*, docs/index.rst, docs/genindex.rst (all .rst).
  • Added the flat layout: docs/{tutorials,how-to,explanations,reference}.md section pages plus tutorials/, how-to/, explanations/ subdirs, converted to Markdown.
  • API reference now generated via autosummary (docs/_api.rst).
  • Dropped the boilerplate developer how-to guides (lint, make-release, pin-requirements, run-tests, static-analysis, test-container, update-tools, dev-install) — these are maintained upstream in the template's own hosted docs.
  • README: added Docker/Documentation table rows and the <!-- README only content marker so docs/index.md can include the shared intro; switched the two screenshots to absolute raw GitHub URLs so they render both on GitHub and in the docs site (a relative docs/images/... path breaks once included into docs/index.md).

Template-driven config changes

  • Add Sphinx dev dependencies (myst-parser, pydata-sphinx-theme, sphinx-design, sphinx-copybutton, sphinx-autobuild) and the docs / docs-autobuild tox envs.
  • Add .github/workflows/_docs.yml (build + publish to gh-pages) and periodic.yml (weekly linkcheck); wire the docs job into ci.yml.
  • Bump devcontainer/runtime base images noble → resolute; uv sync --managed-python in the Dockerfile.
  • Add the Python 3.14 classifier and CI matrix entry; enable doctest collection in pytest.

Verification

  • tox -e docs / sphinx-build --fail-on-warning builds cleanly (zero warnings).
  • ruff check, ruff format --check, pyright, 35 tests, and pre-commit run --all-files all pass; uv.lock updated.
  • An adversarial multi-agent review of the diff (content preservation, build/config, refs/links, CI) found zero confirmed issues.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added a refreshed documentation structure with dedicated landing pages for tutorials, how-tos, explanations, and reference material.
    • Added new guides for installation and running the app in a container.
  • Documentation

    • Expanded API documentation and improved navigation across the docs site.
    • Updated contributor and developer-facing docs links and references.
  • Chores

    • Updated documentation build and publishing setup, including broader test coverage and support for newer Python versions.

Update the project from copier template 5.0.2 to 5.2.0 and switch
docs_type from README to sphinx, reflecting the project's existing
Sphinx documentation.

The new template uses a flat MyST-Markdown docs layout in place of the
old nested reStructuredText tree:

- Remove docs/user/* and docs/developer/* (.rst), docs/index.rst and
  docs/genindex.rst.
- Add flat docs/{tutorials,how-to,explanations,reference}.md section
  pages plus tutorials/, how-to/ and explanations/ subdirs, converted
  to Markdown.
- Regenerate API reference via autosummary (docs/_api.rst).
- Drop the boilerplate developer how-to guides (lint, make-release,
  pin-requirements, run-tests, static-analysis, test-container,
  update-tools, dev-install); these are maintained upstream in the
  template's own hosted docs.
- README: add Docker/Documentation table rows and the "README only
  content" marker so docs/index.md can include the shared intro; use
  absolute raw image URLs so screenshots render on GitHub and in the
  docs site.

Template-driven config changes: add Sphinx dev dependencies and the
docs/docs-autobuild tox envs, add the _docs.yml and periodic.yml
workflows, bump the devcontainer/runtime images noble -> resolute,
add the Python 3.14 classifier, and enable doctest collection.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@coderabbitai

coderabbitai Bot commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The PR updates Copier answers to 5.2.0, adds Sphinx autosummary docs support, restructures the docs into new Markdown landing pages and guides, introduces ADR documents, and changes CI, periodic link checking, Docker, and release-related workflow wiring.

Changes

Documentation migration and workflow updates

Layer / File(s) Summary
Docs build foundation
/.copier-answers.yml, pyproject.toml, docs/conf.py, docs/_templates/custom-module-template.rst, docs/_api.rst, docs/user/reference/api.rst
Copier answers, Sphinx config, autosummary template, and API page wiring are updated, with MyST and doctest/doc build settings added to the tooling config.
Docs entry pages
README.md, docs/index.md, docs/how-to.md, docs/tutorials.md, docs/explanations.md, docs/reference.md, docs/genindex.md, docs/explanations/decisions.md, docs/how-to/contribute.md, docs/user/index.rst, docs/developer/how-to/contribute.rst
README screenshots switch to raw URLs and add a README-only marker, the landing pages define the docs structure, and the old user index and contribution include page are removed.
Installation and container guides
docs/tutorials/installation.md, docs/how-to/run-container.md
The installation tutorial and container how-to describe installing the CLI and running it from a container image.
ADR template and records
docs/explanations/decisions/COPYME, docs/explanations/decisions/0001-record-architecture-decisions.md, docs/explanations/decisions/0002-switched-to-python-copier-template.md, docs/developer/explanations/decisions/0002-switched-to-pip-skeleton.rst
The ADR template is added, two decision records are introduced, and the older pip-skeleton ADR file is removed.
Docs workflows and release wiring
.github/workflows/_docs.yml, .github/workflows/ci.yml, .github/workflows/periodic.yml, Dockerfile, .github/CONTRIBUTING.md, renovate.json
The docs publishing workflow, CI matrix/docs job, periodic link check, Docker base images, contribution link, and Renovate rules are updated.

Sequence Diagram(s)

sequenceDiagram
  participant DocsJob as "ci.yml docs job"
  participant DocsWorkflow as "_docs.yml"
  participant DocsBuild as "uv run --locked tox -e docs"
  participant GhPagesAction as "peaceiris/actions-gh-pages"
  participant GhPagesBranch as "gh-pages"

  DocsJob->>DocsWorkflow: workflow_call
  DocsWorkflow->>DocsBuild: build docs
  DocsBuild-->>DocsWorkflow: build/html
  DocsWorkflow->>DocsWorkflow: move build/html into .github/pages/$DOCS_VERSION
  DocsWorkflow->>DocsWorkflow: regenerate .github/pages/switcher.json
  DocsWorkflow->>GhPagesAction: publish .github/pages
  GhPagesAction->>GhPagesBranch: push with keep_files: true
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

I’m a rabbit with docs in my paws,
Hopping through links without any pause.
New pages and guides,
With tidy side rides,
And carrots for CI applause 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: upgrading the template to 5.2.0 and restructuring the documentation.
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
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch update-copier-template-5.2.0

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

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/explanations/decisions.md (1)

1-13: 🩺 Stability & Availability | 🟠 Major

Fix the toctree glob flag in docs/explanations/decisions.md. :glob: is a flag option, so :glob: true should be changed to :glob: to avoid invalid MyST/Sphinx syntax.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/explanations/decisions.md` around lines 1 - 13, The toctree in
decisions.md uses invalid MyST/Sphinx syntax because the glob option is written
as a value instead of a flag. Update the toctree directive in the Architectural
Decision Records section to use the correct :glob: flag form, keeping the
existing globbed decisions/* target and the rest of the directive unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/how-to/run-container.md`:
- Around line 8-12: Update the container example in the documentation to use a
fixed release tag instead of the mutable latest tag, and change the command
block to a shell-fenced code block. Locate the docker run example in the
run-container guide and replace the image reference with a release-tag
placeholder so the documented image stays stable over time.

In `@docs/tutorials/installation.md`:
- Around line 8-10: The fenced command examples in this tutorial are unlabeled,
which triggers markdownlint and hurts highlighting. Update the shell command
blocks in the installation doc to use the shell fence instead of plain fences,
and apply the same change to each remaining command example. Use the fenced code
blocks around the Python and package manager commands as the anchors for the
edit.

---

Outside diff comments:
In `@docs/explanations/decisions.md`:
- Around line 1-13: The toctree in decisions.md uses invalid MyST/Sphinx syntax
because the glob option is written as a value instead of a flag. Update the
toctree directive in the Architectural Decision Records section to use the
correct :glob: flag form, keeping the existing globbed decisions/* target and
the rest of the directive unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 80eeb812-f16a-41e8-934c-51394a998b50

📥 Commits

Reviewing files that changed from the base of the PR and between 9de85dd and cd0e365.

⛔ Files ignored due to path filters (2)
  • docs/images/dls-logo.svg is excluded by !**/*.svg
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (47)
  • .copier-answers.yml
  • .github/CONTRIBUTING.md
  • .github/workflows/_docs.yml
  • .github/workflows/ci.yml
  • .github/workflows/periodic.yml
  • Dockerfile
  • README.md
  • docs/_api.rst
  • docs/_templates/custom-module-template.rst
  • docs/conf.py
  • docs/developer/explanations/decisions.rst
  • docs/developer/explanations/decisions/0001-record-architecture-decisions.rst
  • docs/developer/explanations/decisions/0002-switched-to-pip-skeleton.rst
  • docs/developer/how-to/build-docs.rst
  • docs/developer/how-to/contribute.rst
  • docs/developer/how-to/lint.rst
  • docs/developer/how-to/make-release.rst
  • docs/developer/how-to/pin-requirements.rst
  • docs/developer/how-to/run-tests.rst
  • docs/developer/how-to/static-analysis.rst
  • docs/developer/how-to/test-container.rst
  • docs/developer/how-to/update-tools.rst
  • docs/developer/index.rst
  • docs/developer/reference/standards.rst
  • docs/developer/tutorials/dev-install.rst
  • docs/explanations.md
  • docs/explanations/decisions.md
  • docs/explanations/decisions/0001-record-architecture-decisions.md
  • docs/explanations/decisions/0002-switched-to-python-copier-template.md
  • docs/explanations/decisions/COPYME
  • docs/genindex.md
  • docs/genindex.rst
  • docs/how-to.md
  • docs/how-to/contribute.md
  • docs/how-to/run-container.md
  • docs/index.md
  • docs/index.rst
  • docs/reference.md
  • docs/tutorials.md
  • docs/tutorials/installation.md
  • docs/user/explanations/docs-structure.rst
  • docs/user/how-to/run-container.rst
  • docs/user/index.rst
  • docs/user/reference/api.rst
  • docs/user/tutorials/installation.rst
  • pyproject.toml
  • renovate.json
💤 Files with no reviewable changes (22)
  • docs/developer/explanations/decisions.rst
  • docs/developer/tutorials/dev-install.rst
  • docs/user/explanations/docs-structure.rst
  • docs/developer/index.rst
  • docs/developer/how-to/make-release.rst
  • docs/developer/how-to/test-container.rst
  • docs/developer/reference/standards.rst
  • docs/user/how-to/run-container.rst
  • docs/developer/how-to/run-tests.rst
  • docs/developer/how-to/contribute.rst
  • docs/developer/how-to/pin-requirements.rst
  • docs/user/tutorials/installation.rst
  • docs/user/index.rst
  • docs/developer/how-to/lint.rst
  • docs/index.rst
  • docs/developer/how-to/build-docs.rst
  • docs/developer/explanations/decisions/0002-switched-to-pip-skeleton.rst
  • docs/developer/explanations/decisions/0001-record-architecture-decisions.rst
  • docs/user/reference/api.rst
  • docs/developer/how-to/static-analysis.rst
  • docs/developer/how-to/update-tools.rst
  • docs/genindex.rst

Comment thread docs/how-to/run-container.md Resolved
Comment thread docs/tutorials/installation.md Resolved
@gilesknap
gilesknap merged commit 1081918 into main Jun 26, 2026
10 checks passed
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