diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 777f9b2..201b221 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,11 +24,12 @@ jobs: python tests/update_submodules.py - name: Install Python package env: - # See https://github.com/pypa/wheel/issues/507: - PYTHONWARNINGS: error,ignore:pkg_resources is deprecated:DeprecationWarning + PYTHONWARNINGS: error,default::DeprecationWarning run: | python -m pip install . - name: Install test dependencies + env: + PYTHONWARNINGS: error,default::DeprecationWarning run: | python -m pip install -r tests/requirements.txt - name: Run pytest diff --git a/src/sphinx_last_updated_by_git.py b/src/sphinx_last_updated_by_git.py index d4b14d7..baad12b 100644 --- a/src/sphinx_last_updated_by_git.py +++ b/src/sphinx_last_updated_by_git.py @@ -276,6 +276,11 @@ def _builder_inited(app): def _source_read(app, docname, source): env = app.env + if docname not in env.found_docs: + # Since Sphinx 7.2, "docname" can be None or a relative path + # to a file included with the "include" directive. + # We are only interested in actual source documents. + return assert docname not in env.git_last_updated env.git_last_updated[docname] = None