Skip to content

tests: ignore setuptools 67.3.0 DeprecationWarning #5167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

bastimeyer
Copy link
Member

@bastimeyer bastimeyer commented Feb 15, 2023

Ignore new pkg_resources.declare_namespace DeprecationWarning which was added in the setuptools 67.3.0 release.


The DeprecationWarning was added in the setuptools 67.3.0 release:

And it gets triggered by the various sphinxcontrib-* namespace packages which are listed as dependencies of the sphinx package.

Namespace packages are packages which contain split up package contents that get then merged upon import, so something like foo.bar and foo.baz can be packaged separately while still being available on the single foo parent package.

Setuptools 67.3.0 wants those namespace packages to be declared implicitly.


I have no clue why it gets raised when running pytest. It does that with every single test module, not just the entire test suite, even though sphinx is completely unrelated to Streamlink's tests or code base. This must mean that pytest is looking up every package installed in the user's python environment, and since docs-requirements are included in the env, the deprecationwarning gets raised when these explicit namespace packages are encountered. Sphinx doesn't even use setuptools. It uses flit.

Example:

=============================================================== warnings summary ===============================================================
../../venv/streamlink-311/lib/python3.11/site-packages/pkg_resources/__init__.py:2804
../../venv/streamlink-311/lib/python3.11/site-packages/pkg_resources/__init__.py:2804
../../venv/streamlink-311/lib/python3.11/site-packages/pkg_resources/__init__.py:2804
../../venv/streamlink-311/lib/python3.11/site-packages/pkg_resources/__init__.py:2804
  /home/basti/venv/streamlink-311/lib/python3.11/site-packages/pkg_resources/__init__.py:2804: DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('sphinxcontrib')`.
  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
================================================== 117 passed, 4 skipped, 4 warnings in 0.24s ==================================================

Btw, this doesn't come up in the GH test runners, because Sphinx doesn't get installed.

Ignore new `pkg_resources.declare_namespace` DeprecationWarning
which was added in the setuptools 67.3.0 release.
@gravyboat gravyboat merged commit c3ff5a0 into streamlink:master Feb 15, 2023
@bastimeyer bastimeyer deleted the tests/ignore-setuptools-67.3.0-deprecation branch February 15, 2023 18:36
@bastimeyer
Copy link
Member Author

I have no clue why it gets raised when running pytest

#5230 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants