From 9752da2b033e87945095833b3ec8cc67fa0aee23 Mon Sep 17 00:00:00 2001 From: Daniel Valenzuela Date: Wed, 25 Oct 2023 20:32:00 -0300 Subject: [PATCH] chore: ignore warning from pkg_resources.declare_namespace Related issue: https://github.com/openedx/edx-platform/issues/33592 --- cms/pytest.ini | 4 ++++ common/test/pytest.ini | 5 +++++ openedx/core/lib/logsettings.py | 10 ++++++++++ setup.cfg | 4 ++++ 4 files changed, 23 insertions(+) diff --git a/cms/pytest.ini b/cms/pytest.ini index 2c7bc22f3a1..65e35095890 100644 --- a/cms/pytest.ini +++ b/cms/pytest.ini @@ -16,6 +16,10 @@ filterwarnings = ignore:.*You can remove default_app_config.*:PendingDeprecationWarning # ABC deprecation Warning comes from libsass ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated.*:DeprecationWarning:sass + # declare_namespace Warning comes from XBlock https://github.com/openedx/XBlock/issues/641 + # and also due to dependency: https://github.com/PyFilesystem/pyfilesystem2 + ignore:Deprecated call to `pkg_resources.declare_namespace.*:DeprecationWarning + ignore:.*pkg_resources is deprecated as an API.*:DeprecationWarning norecursedirs = envs python_classes = diff --git a/common/test/pytest.ini b/common/test/pytest.ini index a4fcf204236..05d334a6e1b 100644 --- a/common/test/pytest.ini +++ b/common/test/pytest.ini @@ -15,4 +15,9 @@ filterwarnings = ignore:.*You can remove default_app_config.*:PendingDeprecationWarning # ABC deprecation Warning comes from libsass ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated.*:DeprecationWarning:sass + # declare_namespace Warning comes from XBlock https://github.com/openedx/XBlock/issues/641 + # and also due to dependency: https://github.com/PyFilesystem/pyfilesystem2 + ignore:Deprecated call to `pkg_resources.declare_namespace.*:DeprecationWarning + ignore:.*pkg_resources is deprecated as an API.*:DeprecationWarning + norecursedirs = .cache diff --git a/openedx/core/lib/logsettings.py b/openedx/core/lib/logsettings.py index 0ea195f1f27..eea23df14ef 100644 --- a/openedx/core/lib/logsettings.py +++ b/openedx/core/lib/logsettings.py @@ -144,6 +144,16 @@ def log_python_warnings(): category=DeprecationWarning, module="sass", ) + warnings.filterwarnings( + 'ignore', + 'Deprecated call to `pkg_resources.declare_namespace.*', + category=DeprecationWarning, + ) + warnings.filterwarnings( + 'ignore', + '.*pkg_resources is deprecated as an API.*', + category=DeprecationWarning, + ) # try: # # There are far too many of these deprecation warnings in startup to output for every management command; # # suppress them until we've fixed at least the most common ones as reported by the test suite diff --git a/setup.cfg b/setup.cfg index cc48260efc7..27ecdc7cea7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -17,6 +17,10 @@ filterwarnings = ignore:Instead access HTTPResponse.headers directly.*:DeprecationWarning:elasticsearch # ABC deprecation Warning comes from libsass ignore:Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated.*:DeprecationWarning:sass + # declare_namespace Warning comes from XBlock https://github.com/openedx/XBlock/issues/641 + # and also due to dependency: https://github.com/PyFilesystem/pyfilesystem2 + ignore:Deprecated call to `pkg_resources.declare_namespace.*:DeprecationWarning + ignore:.*pkg_resources is deprecated as an API.*:DeprecationWarning junit_family = xunit2 norecursedirs = .* *.egg build conf dist node_modules test_root cms/envs lms/envs