Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extensions/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def hook(self, context: dict[Any, Any]) -> dict[Any, Any]:
context["pytest_randomly_version"] = "4.0.1"
context["pytest_cov_version"] = "7.0.0"
#######
context["sphinx_version"] = "8.1.3"
context["sphinx_version"] = "9.0.4"
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, examine the file to understand context
head -50 extensions/context.py | cat -n

Repository: LabAutomationAndScreening/copier-base-template

Length of output: 2654


🌐 Web query:

Sphinx 9.0.4 release official version valid

💡 Result:

Yes — Sphinx 9.0.4 is an official release (released Dec 4, 2025). Evidence: the Sphinx changelog shows "Release 9.0.4 (released Dec 04, 2025)." [1] The PyPI project page lists and provides the signed v9.0.4 packages (uploaded Dec 4, 2025) with provenance metadata. [2]

Sources:
[1] Sphinx changelog — Sphinx 9.0 (changes).
[2] Sphinx on PyPI (sphinx‑9.0.4 files & provenance).


🌐 Web query:

Sphinx 9.0 breaking changes migration guide

💡 Result:

Here are the key breaking changes in Sphinx 9.0 and concise migration steps.

Summary of breaking changes (from the official 9.0 release notes). [1]

  • Autodoc rewritten: sphinx.ext.autodoc was substantially rewritten; this can break extensions or code that relied on autodoc internals. A config option autodoc_use_legacy_class_based is provided to restore the pre‑9.0 behavior. [1]
  • SphinxComponentRegistry.create_source_parser() signature changed: it no longer accepts an app parameter — it now takes config and env. Update any code/extension that calls this API. [1]
  • Non‑decodable bytes in source files now raise an error (previously were replaced by "?" and only warned). Ensure source files are properly encoded (UTF‑8) or pre‑clean inputs. [1]
  • Don’t include escaped title content in the search index (search index behavior changed). Review any tooling that depended on the old indexed content. [1]

Recommended migration steps

  1. Pin and test

    • Pin Sphinx to 9.x in a test branch (pip install "sphinx>=9.0,<10.0") and run your full doc build and CI. Fix issues before rolling to main.
  2. Autodoc compatibility

    • If builds break due to autodoc/extension interactions, set in conf.py:
      autodoc_use_legacy_class_based = True
      then update the extensions or code to work with the new autodoc implementation and remove the legacy flag once fixed. [1]
  3. Update extension/extension calls

    • Search your codebase and third‑party extensions for calls to SphinxComponentRegistry.create_source_parser() and change arguments from (app, ...) to (config, env, ...), following the new signature. Test extension APIs. [1]
  4. Fix file encodings and sources

    • Convert any files with non‑UTF‑8 or non‑decodable bytes to UTF‑8 and remove stray non‑decodable bytes. Treat build warnings about encoding as errors to find offending files. [1]
  5. Search/index differences

    • If you rely on the old behavior of titles being escaped in the index, re‑test search and update any consumer code or search customization to match the new indexed content. [1]
  6. Upgrade third‑party extensions/themes

    • Upgrade sphinx plugins, themes, and custom extensions to versions that declare Sphinx 9 support. If an extension uses autodoc internals or Sphinx internals, check its changelog or issue tracker for 9.x fixes.
  7. Use CI and automated regressions

    • Add a doc build step to CI that runs Sphinx with warnings-as-errors (SPHINXOPTS='-W') to catch regressions early.

If you want, I can:

  • scan your conf.py and extensions to find likely incompatible calls (like create_source_parser usage) and give exact edits; or
  • produce a short checklist/PR template to upgrade a project to Sphinx 9.0.

Sources

  • Sphinx 9.0 release notes / incompatible changes. [1]
  • Sphinx release process (versioning & deprecation guidance). [2]

References
[1] Sphinx 9.0 release notes — Sphinx documentation.
[2] Sphinx’s release process — Sphinx documentation.


Ensure downstream projects test documentation builds with Sphinx 9.0.4 to account for breaking changes.

Sphinx 9.0.4 is a valid official release (Dec 4, 2025), but the major version bump introduces breaking changes that downstream projects need to handle. Key changes include:

  • Autodoc rewritten (may break custom extensions relying on autodoc internals—use autodoc_use_legacy_class_based = True as a temporary workaround)
  • SphinxComponentRegistry.create_source_parser() API signature changed
  • Non-decodable bytes in source files now raise errors instead of warnings
  • Search index behavior changed for escaped title content

Verify that projects generated from this template have tested their documentation builds with Sphinx 9.0.4 and updated any extensions or themes to Sphinx 9.x-compatible versions.

🤖 Prompt for AI Agents
In extensions/context.py around line 27, the template currently pins
context["sphinx_version"] = "9.0.4" but downstream projects need explicit
guidance and CI/test support for Sphinx 9.x breaking changes; update this area
to (1) keep the pinned version but add a brief comment/instruction that
downstream projects must run documentation builds against Sphinx 9.0.4 in CI,
(2) document the recommended temporary workaround autodoc_use_legacy_class_based
= True for autodoc breakage, (3) add notes to the template README or docs
scaffold to check extensions/themes for Sphinx 9.x compatibility and to handle
changed APIs and stricter byte-decoding, and (4) ensure the project's dev
requirements / docs build job in CI are updated to install/test with
Sphinx==9.0.4 so failures surface early.

context["pulumi_version"] = "3.208.0"
context["pulumi_aws_version"] = "7.12.0"
context["pulumi_aws_native_version"] = "1.38.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
from typing import Any
from typing import cast

import pytest
from pydantic import JsonValue
from vcr import VCR

UNREACHABLE_IP_ADDRESS = "192.0.2.1" # RFC 5737 TEST-NET-1
Expand Down Expand Up @@ -42,7 +42,7 @@ def pytest_recording_configure(
)
vcr.match_on += ("body",) # body is not included by default, but it seems relevant

def before_record_response(response: dict[str, JsonValue]) -> dict[str, JsonValue]:
def before_record_response(response: dict[str, str | dict[str, Any]]) -> dict[str, str | dict[str, Any]]:
headers_to_filter = (
"Transfer-Encoding",
"Date",
Expand Down