From 19c30610aa5844c087b1fdd7fb4c1f41ae2d639c Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 4 Jan 2024 19:42:27 +0100 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=A7=AA=20Turn=20warnings=20into=20err?= =?UTF-8?q?ors=20in=20docs=20build=20envs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .readthedocs.yaml | 7 ++++++- tox.ini | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 51c5c810a..626dd2d8b 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -13,14 +13,19 @@ build: python: >- 3.10 commands: - - python -Im venv "${READTHEDOCS_VIRTUALENV_PATH}" - >- + PYTHONWARNINGS=error + python -Im venv "${READTHEDOCS_VIRTUALENV_PATH}" + - >- + PYTHONWARNINGS=error "${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im pip install tox - >- + PYTHONWARNINGS=error "${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im tox -e build-docs --notest -vvvvv - >- + PYTHONWARNINGS=error SPHINX_BUILDER=dirhtml SPHINX_BUILD_OUTPUT_DIRECTORY="${READTHEDOCS_OUTPUT}"/html "${READTHEDOCS_VIRTUALENV_PATH}"/bin/python -Im diff --git a/tox.ini b/tox.ini index 3cf0c78e1..44d2da58c 100644 --- a/tox.ini +++ b/tox.ini @@ -355,6 +355,8 @@ passenv = SPHINX_BUILDER SPHINX_BUILD_OUTPUT_DIRECTORY SSH_AUTH_SOCK +setenv = + PYTHONWARNINGS = error skip_install = true From 1664834ec78488cf63df56b3b65fa9304cb6a6d3 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 4 Jan 2024 20:15:00 +0100 Subject: [PATCH 2/5] Suppress known warnings from underlying tools Ref: https://github.com/pypa/pip/issues/12243 --- tox.ini | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 44d2da58c..712bad0d6 100644 --- a/tox.ini +++ b/tox.ini @@ -356,7 +356,11 @@ passenv = SPHINX_BUILD_OUTPUT_DIRECTORY SSH_AUTH_SOCK setenv = - PYTHONWARNINGS = error + # NOTE: `pip` vendors deprecated `setuptools`' `pkg_resources`, causing + # NOTE: an unfixable deprecation error, so it's suppressed here. Older + # NOTE: `towncrier` versions hit it too. Some `sphinxcontrib` namespace + # NOTE: extensions haven't yet been upgraded to using PEP 420 either: + PYTHONWARNINGS = error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:pkg_resources is deprecated as an API.:DeprecationWarning:towncrier._settings.load,once:Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.:DeprecationWarning skip_install = true From 60b0d83db83c7c9dd32e3a5326943c5d60d27450 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 4 Jan 2024 20:21:43 +0100 Subject: [PATCH 3/5] Suppress `click-default-group` pkg_resources use --- tox.ini | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 712bad0d6..71b745edd 100644 --- a/tox.ini +++ b/tox.ini @@ -359,8 +359,9 @@ setenv = # NOTE: `pip` vendors deprecated `setuptools`' `pkg_resources`, causing # NOTE: an unfixable deprecation error, so it's suppressed here. Older # NOTE: `towncrier` versions hit it too. Some `sphinxcontrib` namespace - # NOTE: extensions haven't yet been upgraded to using PEP 420 either: - PYTHONWARNINGS = error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:pkg_resources is deprecated as an API.:DeprecationWarning:towncrier._settings.load,once:Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.:DeprecationWarning + # NOTE: extensions haven't yet been upgraded to using PEP 420 either. + # NOTE: Also, one of the warnings comes from the `click-default-group` build: + PYTHONWARNINGS = error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:pkg_resources is deprecated as an API.:DeprecationWarning:setuptools.command.test,once:pkg_resources is deprecated as an API.:DeprecationWarning:towncrier._settings.load,once:Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.:DeprecationWarning skip_install = true From c363ef53a67a7329c46a300e69bc3285161d70a2 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 4 Jan 2024 20:34:35 +0100 Subject: [PATCH 4/5] Multiline warnings setup in tox config --- tox.ini | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 71b745edd..99598426a 100644 --- a/tox.ini +++ b/tox.ini @@ -361,7 +361,12 @@ setenv = # NOTE: `towncrier` versions hit it too. Some `sphinxcontrib` namespace # NOTE: extensions haven't yet been upgraded to using PEP 420 either. # NOTE: Also, one of the warnings comes from the `click-default-group` build: - PYTHONWARNINGS = error,once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs,once:pkg_resources is deprecated as an API.:DeprecationWarning:setuptools.command.test,once:pkg_resources is deprecated as an API.:DeprecationWarning:towncrier._settings.load,once:Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.:DeprecationWarning + PYTHONWARNINGS = \ + error, \ + once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs, \ + once:pkg_resources is deprecated as an API.:DeprecationWarning:setuptools.command.test, \ + once:pkg_resources is deprecated as an API.:DeprecationWarning:towncrier._settings.load, \ + once:Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.:DeprecationWarning skip_install = true From 0e5118bf73c8c1407cd8224bcc0f930b07cb77f5 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Thu, 4 Jan 2024 20:50:34 +0100 Subject: [PATCH 5/5] Suppress `setup.py` invocation deprecation warn --- tox.ini | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 99598426a..2bb1ff171 100644 --- a/tox.ini +++ b/tox.ini @@ -366,7 +366,8 @@ setenv = once:pkg_resources is deprecated as an API.:DeprecationWarning:pip._internal.metadata.importlib._envs, \ once:pkg_resources is deprecated as an API.:DeprecationWarning:setuptools.command.test, \ once:pkg_resources is deprecated as an API.:DeprecationWarning:towncrier._settings.load, \ - once:Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.:DeprecationWarning + once:Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.:DeprecationWarning, \ + once:setup.py install is deprecated.: skip_install = true