Skip to content

docs: load sphinx_click before sphinx_autodoc_typehints - #534

Merged
Guts merged 1 commit into
masterfrom
docs/fix-sphinx-click-mock
Nov 6, 2026
Merged

Guts merged 1 commit into
masterfrom
docs/fix-sphinx-click-mock

Conversation

@Guts

@Guts Guts commented Nov 6, 2026

Copy link
Copy Markdown
Owner

Description

docs/usage/cli.md was empty: sphinx-click failed with TypeError: 'module' object is not callable when importing dicogis.cli.main:click_object.

With Sphinx 9.1, from sphinx.ext.autodoc import mock returns the mock module instead of the function once sphinx_autodoc_typehints has been imported (sphinx-doc/sphinx#14333), and sphinx_click calls it. Loading sphinx_click first in extensions keeps the function. The order is no longer alphabetical, hence the comment in docs/conf.py.

Reproduced on a minimal Sphinx project with both extension orders: the error occurs with sphinx_autodoc_typehints first and not with sphinx_click first. The full build has not been run locally, so the CI run of this PR is the confirmation.

Related issue(s)

Follows #532.

Type of change

  • Bug fix (fix/… branch)
  • New feature or enhancement (feature/… branch)
  • Documentation (docs/… branch or *.md/docs/** changes)
  • Packaging / build (packaging/… branch or builder/** changes)
  • Tooling / CI-CD (tooling/… branch or .github/** changes)
  • Tests only (tests/** changes)

Checklist

  • I have read the Contributing Guidelines
  • pre-commit run --all-files passes locally
  • I have added or updated tests covering my changes
  • I have updated the documentation where relevant
  • pytest passes locally

AI/LLM disclosure


Generated by Claude Code

With Sphinx 9.1, "from sphinx.ext.autodoc import mock" returns the mock module instead of the function once sphinx_autodoc_typehints has been imported, so sphinx_click failed with "'module' object is not callable" and the CLI page was empty. Loading sphinx_click first keeps the function (see sphinx-doc/sphinx#14333).

AI-Level: 7
AI-Model: Claude Sonnet 5.5
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CUNZAXTg3vthj5KZYCgf3m
@github-actions github-actions Bot added bug Houston, we've a problem! documentation Improvements or additions to documentation CLI Command Line Interface labels Nov 6, 2026
@sonarqubecloud

sonarqubecloud Bot commented Nov 6, 2026

Copy link
Copy Markdown

@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.23%. Comparing base (12e28d1) to head (ecc7f64).
⚠️ Report is 12 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #534   +/-   ##
=======================================
  Coverage   78.23%   78.23%           
=======================================
  Files          54       54           
  Lines        3469     3469           
  Branches      435      435           
=======================================
  Hits         2714     2714           
  Misses        633      633           
  Partials      122      122           
Flag Coverage Δ
unittests 78.17% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Guts
Guts merged commit 3fa9770 into master Nov 6, 2026
17 checks passed
@Guts
Guts deleted the docs/fix-sphinx-click-mock branch November 6, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Houston, we've a problem! CLI Command Line Interface documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants