Skip to content

fix: update Config.read() signature (overrides, tags)#202

Open
kimbyungnam wants to merge 2 commits into
sphinx-contrib:mainfrom
kimbyungnam:201
Open

fix: update Config.read() signature (overrides, tags)#202
kimbyungnam wants to merge 2 commits into
sphinx-contrib:mainfrom
kimbyungnam:201

Conversation

@kimbyungnam

Copy link
Copy Markdown

Purpose

This PR fixes an incompatibility with newer Sphinx versions (≥ 9) when using sphinx-multiversion on Python 3.11+.

Starting from Sphinx 8.2.0, Python 3.11+ is required.
sphinx-multiversion officially supports Python 8–12, but it currently does not restrict the Sphinx version
As a result, when users run sphinx-multiversion on Python 3.11 or newer, Sphinx 9+ is automatically installed

In Sphinx 9, the signature of Config.read() requires keyword arguments:
However, sphinx-multiversion was still calling it using the old positional-style API, causing runtime errors when used with Sphinx ≥ 9 (see #201).

Resolves #201

Solution Sketch

This PR updates all calls to Config.read() to:

  • Pass arguments explicitly as keyword arguments
  • Provide a Tags() instance explicitly

The parameter names (overrides, tags) are consistent across Sphinx 7 through 9, so using keyword arguments is safe and compatible across Python 3.8–3.12

  • Avoids introducing conditional logic based on Sphinx versions
  • Maintains backward compatibility with older supported Sphinx releases
  • Fixes the issue without tightening dependency constraints
  • Aligns with the current Sphinx public API

kimbyungnam and others added 2 commits January 14, 2026 23:22
Sphinx>=9 Config.read() now expects keyword args; update calls to use
overrides=... and provide Tags() to keep config loading consistent.

Fixes sphinx-contrib#201.
@grabear

grabear commented May 26, 2026

Copy link
Copy Markdown

This is working for me. I did something similar and I was going to make a PR, but it's already been done 😄 @Holzhaus

horazont pushed a commit to alasca-association/tarook that referenced this pull request Jun 19, 2026
sphinx-multiversion seems to have been unmaintained for years. Nixpkgs
26.05 bumps Sphinx to v9 which is incompatible with the latest release
of sphinx-multiversion. There exists a pull request[1] upstream that
fixes the incompatibility, but it hasn't been merged yet (and it is
unclear if it ever will be).

This commit applies the patch from the PR to the package while building
the dependencies,
allowing us to switch to nixpkgs-26.05 while considering alternatives to
sphinx-multiversion.

[1] sphinx-contrib/multiversion#202
horazont pushed a commit to alasca-association/tarook that referenced this pull request Jun 19, 2026
sphinx-multiversion seems to have been unmaintained for years. Nixpkgs
26.05 bumps Sphinx to v9 which is incompatible with the latest release
of sphinx-multiversion. There exists a pull request[1] upstream that
fixes the incompatibility, but it hasn't been merged yet (and it is
unclear if it ever will be).

This commit applies the patch from the PR to the package while building
the dependencies,
allowing us to switch to nixpkgs-26.05 while considering alternatives to
sphinx-multiversion.

[1] sphinx-contrib/multiversion#202
horazont pushed a commit to alasca-association/tarook that referenced this pull request Jun 22, 2026
sphinx-multiversion seems to have been unmaintained for years. Nixpkgs
26.05 bumps Sphinx to v9 which is incompatible with the latest release
of sphinx-multiversion. There exists a pull request[1] upstream that
fixes the incompatibility, but it hasn't been merged yet (and it is
unclear if it ever will be).

This commit applies the patch from the PR to the package while building
the dependencies,
allowing us to switch to nixpkgs-26.05 while considering alternatives to
sphinx-multiversion.

[1] sphinx-contrib/multiversion#202
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.

Incompatibility with Sphinx >=9.0: Config.read() TypeError during build

2 participants