From 96a0a9b325f2abb7b35850e3423fed304c48f76f Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 26 Aug 2023 10:54:39 +0200 Subject: [PATCH 1/2] CI: Don't turn DeprecationWarning into an error --- .github/workflows/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 From fd45ddfcbadb143eb77924e9e858242dce71acb4 Mon Sep 17 00:00:00 2001 From: Matthias Geier Date: Sat, 26 Aug 2023 12:36:10 +0200 Subject: [PATCH 2/2] Only check source files that are in "found_docs" --- src/sphinx_last_updated_by_git.py | 5 +++++ 1 file changed, 5 insertions(+) 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