Skip to content

Replace deprecated load_module in docs conf - #4043

Merged
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/docs-conf-exec-module
Aug 27, 2026
Merged

Replace deprecated load_module in docs conf#4043
gaborbernat merged 1 commit into
tox-dev:mainfrom
gaborbernat:fix/docs-conf-exec-module

Conversation

@gaborbernat

Copy link
Copy Markdown
Member

main is red on tox env type:

docs/conf.py:176:71: warning[deprecated] The function `load_module` is deprecated:
  Deprecated since Python 3.10; removed in Python 3.15. Use `exec_module()` instead.
Found 1 diagnostic

Nothing in the tree changed. ty 0.0.75 landed a deprecated lint, ty is unpinned at >=0.0.19, and the type environment runs with --error-on-warning, so the new diagnostic became a failure.

The deprecation is worth acting on rather than silencing: load_module is gone in 3.15, and the test matrix already runs 3.15. docs/conf.py now builds the module and executes it through the loader instead.

Verified with tox -e type (ty 0.0.75, mypy, pyrefly all clean) and tox -e docs, which builds with -W. The conf directive still registers and renders - reference/config.html comes out at 389 KB with every setting in place.

SourceFileLoader.load_module is deprecated since 3.10 and gone in 3.15,
which the test matrix already covers. ty 0.0.75 started flagging it, and
the type environment runs with --error-on-warning, so main went red.
@gaborbernat
gaborbernat force-pushed the fix/docs-conf-exec-module branch from d04bf01 to 44c7858 Compare August 27, 2026 14:53
@gaborbernat
gaborbernat merged commit 930190c into tox-dev:main Aug 27, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant