Skip to content

build: upgrade Sphinx 4→7, drop m2r2/recommonmark, Python 3.11+#167

Merged
ErikBjare merged 3 commits intoActivityWatch:masterfrom
TimeToBuildBob:fix/sphinx-upgrade
Feb 27, 2026
Merged

build: upgrade Sphinx 4→7, drop m2r2/recommonmark, Python 3.11+#167
ErikBjare merged 3 commits intoActivityWatch:masterfrom
TimeToBuildBob:fix/sphinx-upgrade

Conversation

@TimeToBuildBob
Copy link
Contributor

@TimeToBuildBob TimeToBuildBob commented Feb 27, 2026

Fixes #157.

Upgrades the docs build stack to work with Python 3.13, which removed imghdr (breaking Sphinx 4.x's epub builder and other internals).

Changes

  • Sphinx 4.x → >=7.0 (resolves Python 3.13 incompatibility; resolves Pin Python version (or update Sphinx) #157)
  • Drop m2r2 + recommonmark — both unmaintained and incompatible with Sphinx 7+. Replaced by myst-parser which already handles all Markdown needs
  • Drop setuptools workaround (was only needed for m2r2 on Python 3.12+)
  • myst-parser pinned to >=2.0 (explicit requirement for Sphinx 7+)
  • sphinx_rtd_theme >=2.0, sphinx-tabs ^3.4, sphinx-click >=6.0
  • Python constraint: ^3.8^3.11
  • .readthedocs.yml: python 3.11 → 3.13 (per Erik's preference)
  • CI: actions/checkout@v2→v4, setup-python@v1→v5, python 3.12 → 3.13
  • Regenerated poetry.lock (sphinx 9.0.4, myst-parser 5.0.0)

conf.py

Replaced "m2r2" extension with "myst_parser". The .md files in changelog/ have corresponding .rst counterparts which are what's actually included — no functional change.


Important

Upgrade Sphinx to >=7.0, replace unmaintained dependencies, and update configurations for Python 3.13 compatibility.

  • Dependencies:
    • Upgrade Sphinx from 4.x to >=7.0 in pyproject.toml.
    • Replace m2r2 and recommonmark with myst-parser >=2.0.
    • Update sphinx_rtd_theme to >=2.0, sphinx-tabs to ^3.4, and sphinx-click to >=6.0.
    • Remove setuptools workaround.
  • Python Version:
    • Update Python constraint from ^3.8 to ^3.11 in pyproject.toml.
    • Change Python version to 3.13 in .readthedocs.yml and build.yml.
  • CI/CD:
    • Update actions/checkout to v4 and setup-python to v5 in build.yml.
  • Configuration:
    • Replace "m2r2" with "myst_parser" in conf.py.

This description was created by Ellipsis for 8d94eef. You can customize this summary. It will automatically update as commits are pushed.

- Upgrade sphinx 4.x → >=7.0 (resolves Python 3.13 incompatibility from
  imghdr removal, closes ActivityWatch#157)
- Replace m2r2 + recommonmark with myst-parser >=2.0 (handles all Markdown;
  m2r2/recommonmark are unmaintained and incompatible with Sphinx 7+)
- Drop setuptools workaround (was needed only for m2r2)
- Pin python >=3.11 (matching .readthedocs.yml; 3.13 in CI/RTD)
- Bump sphinx_rtd_theme to >=2.0, sphinx-tabs to ^3.4, sphinx-click to >=6.0
- Update .readthedocs.yml: python 3.11 → 3.13
- Update CI: actions/checkout@v2→v4, setup-python@v1→v5, python 3.12→3.13
- Regenerate poetry.lock (sphinx 9.0.4, myst-parser 5.0.0)
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

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

Important

Looks good to me! 👍

Reviewed everything up to 8d94eef in 10 seconds. Click for details.
  • Reviewed 84 lines of code in 4 files
  • Skipped 1 files when reviewing.
  • Skipped posting 0 draft comments. View those below.
  • Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.

Workflow ID: wflow_F2wJaZCpW28y14Pw

You can customize Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

- Add %s to extlinks captions (required by Sphinx 7+)
- Set language = "en" instead of None (deprecated in Sphinx 9)
- Exclude changelog/*.md from build (duplicates of .rst files
  that cause "multiple files found" warnings with myst-parser)
sphinx-tabs 3.4.7 has a known KeyError on 'backrefs' with Sphinx 9
(executablebooks/sphinx-tabs#209). Pin to Sphinx 8.x which supports
Python 3.13 and is compatible with all current extensions.
@TimeToBuildBob
Copy link
Contributor Author

@greptileai review

@ErikBjare ErikBjare changed the title build: upgrade Sphinx 4→9, drop m2r2/recommonmark, Python 3.11+ build: upgrade Sphinx 4→7, drop m2r2/recommonmark, Python 3.11+ Feb 27, 2026
@greptile-apps
Copy link

greptile-apps bot commented Feb 27, 2026

Greptile Summary

Upgraded documentation build stack to Sphinx 8.x for Python 3.13 compatibility, resolving the imghdr removal issue that broke Sphinx 4.x.

Key changes:

  • Sphinx upgraded from 4.x to 8.x (constrained to <9 due to sphinx-tabs compatibility issue)
  • Replaced unmaintained m2r2 and recommonmark with myst-parser >=2.0
  • Updated all Sphinx extensions to compatible versions (sphinx_rtd_theme >=2.0, sphinx-tabs ^3.4, sphinx-click >=6.0)
  • Python constraint changed from ^3.8 to ^3.11, with CI/ReadTheDocs using Python 3.13
  • Fixed Sphinx 7+ configuration: added %s placeholders to extlinks, set language = "en", excluded duplicate changelog/*.md files
  • Updated CI actions to latest versions (checkout@v4, setup-python@v5)

Confidence Score: 5/5

  • This PR is safe to merge with no issues found
  • All changes are well-coordinated across configuration files, dependency versions are properly constrained for compatibility, Sphinx 7+ configuration updates are correct, and the upgrade path addresses a real Python 3.13 compatibility issue. The PR went through multiple iterations to resolve compatibility issues (3 commits), demonstrating thorough testing.
  • No files require special attention

Important Files Changed

Filename Overview
pyproject.toml Upgraded Sphinx to 8.x (constrained <9 for sphinx-tabs compatibility), replaced unmaintained m2r2/recommonmark with myst-parser, updated dependency versions, and changed Python constraint from ^3.8 to ^3.11
src/conf.py Replaced m2r2 extension with myst_parser, fixed extlinks format for Sphinx 7+ (added %s placeholders), set language to "en", and excluded duplicate changelog/*.md files
.github/workflows/build.yml Updated checkout action to v4, setup-python to v5, and Python version from 3.12 to 3.13
.readthedocs.yml Updated Python version from 3.11 to 3.13 for ReadTheDocs build
poetry.lock Regenerated lockfile with Sphinx 8.2.3, myst-parser 5.0.0, and updated transitive dependencies

Last reviewed commit: 537397c

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ErikBjare ErikBjare merged commit bd38394 into ActivityWatch:master Feb 27, 2026
1 check 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.

Pin Python version (or update Sphinx)

2 participants