Add support for newer Sphinx versions, fix up some related warnings.

Review Request #14476 — Created June 25, 2025 and submitted

Information

beanbag-docutils
master

Reviewers

This change adds support for Sphinx 8.0 to our pyproject.toml and
tox.ini files, and fleshes out the tox configuration a bit for wider
version compatibility checking.

This also fixes a few warnings that were popping up when using
collect_files against Sphinx 7.4:

  • The default for collect_file_patterns was set to a dict, but it was
    used as a list.
  • The "rebuild" parameter for app.add_config_value() has changed from a
    simple bool to a string defining when to rebuild. The string version
    is supported in all our supported versions.
  • The comparison against Sphinx's src_dir warned that we should use
    pathlib.Path or os.fspath instead of a string.

Ran tests via tox.

Summary ID
Add support for newer Sphinx versions, fix up some related warnings.
This change adds support for Sphinx 8.0 to our pyproject.toml and tox.ini files, and fleshes out the tox configuration a bit for wider version compatibility checking. This also fixes a few warnings that were popping up when using collect_files against Sphinx 7.4: - The default for `collect_file_patterns` was set to a dict, but it was used as a list. - The "rebuild" parameter for app.add_config_value() has changed from a simple bool to a string defining when to rebuild. The string version is supported in all our supported versions. - The comparison against Sphinx's `src_dir` warned that we should use `pathlib.Path` or `os.fspath` instead of a string. Testing Done: Ran tests via tox.
1f7a7f267b6f9d697c96d33de54bfadaa59f516d
Description From Last Updated

I was curious about the rename. I guess that's your linter upset about an unused parameter? I don't think we …

chipx86chipx86

I don't think this is safe. Sphinx 5 uses strings for srcdir, and a comparison between a Path(...) and a …

chipx86chipx86
chipx86
  1. 
      
  2. Show all issues

    I was curious about the rename. I guess that's your linter upset about an unused parameter? I don't think we should get in the habit of altering function signatures for that requirement, as that's going to pose problems depending on how the function is called. That should just be turned off on any linter for arguments.

  3. Show all issues

    I don't think this is safe. Sphinx 5 uses strings for srcdir, and a comparison between a Path(...) and a string fails.

    Probably better to normalize srcdir to a string before entering this loop.

  4. 
      
david
maubin
  1. Ship It!
  2. 
      
chipx86
  1. Ship It!
  2. 
      
david
Review request changed
Status:
Completed
Change Summary:
Pushed to master (f16066c)