verified-sources icon indicating copy to clipboard operation
verified-sources copied to clipboard

Warnings in test runner due to deprecated call to pkg_resources.declare_namespace

Open willi-mueller opened this issue 1 year ago • 0 comments

Source name Probably all sources

Make sure that

  • [x] I checked the README in the source folder Not applicable
  • [x] If I have problems with the credentials I checked the credentials docs and troubleshooting Not applicable

Describe the bug Whenever I execute the test runner or make format-lint I get the following warnings which cloud the logs of the test suite that I want to inspect.

To Reproduce

  • Execute test suite in isolation, e.g. pytest tests/notion
  • Execute make format-lint

Expected behavior The deprecation warning should not exist

Stack traces and other evidence

========================================================================= warnings summary ==========================================================================
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/dlt/helpers/dbt/__init__.py:3
  /Users/vilasa/Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/dlt/helpers/dbt/__init__.py:3: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
    import pkg_resources

../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
  /Users/vilasa/Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
  /Users/vilasa/Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google.analytics')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2350
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2350
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2350
  /Users/vilasa/Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2350: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(parent)

../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
  /Users/vilasa/Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google.cloud')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

../../Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871
  /Users/vilasa/Library/Caches/pypoetry/virtualenvs/dlt-verified-sources-oVE4GiVX-py3.9/lib/python3.9/site-packages/pkg_resources/__init__.py:2871: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('google.logging')`.
  Implementing implicit namespace packages (as specified in PEP 420) is preferred to `pkg_resources.declare_namespace`. See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
    declare_namespace(pkg)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

Running environment

  • OS: Mac OS, Windows 11
  • dlt Version 0.42
  • Virtualization / Runner: local

Additional context

I found that people got it fixed by upgrading dependencies or silencing the warnings

willi-mueller avatar Feb 02 '24 10:02 willi-mueller