-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: DeprecationWarning for pkg_resources.declare_namespace usage in mpl_toolkit #25244
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
Comments
Is there a good guide for how to migrate from "old" namespace packages to "new" namespace packages? What is going to break if we just delete this |
Medium difficulty because it requires understanding packaging related issues but good first issue because it requires no understanding of Matplotlib to do. Tasks:
|
See also: matplotlib/matplotlib#25244 Run tests directly rather than as a subprocess so that pytest filterwarnings options have their intended effect.
As of setuptools v67.3.0 the use of pkg_resources.declare_namespace in lib/mpl_toolkits/__init__.py raises a DeprecationWarning. See also: matplotlib/matplotlib#25244 Run tests directly rather than as a subprocess so that pytest filterwarnings options have their intended effect.
To answer this, I'll quote https://packaging.python.org/en/latest/guides/packaging-namespace-packages/#native-namespace-packages
And from the same source:
In other words, any dependent code that implements a I haven't found a solution to warn about the transition from within matplotlib, so currently my recommendation would be to just reach out to downstream developers by any means appropriate. |
As of setuptools v67.3.0 the use of pkg_resources.declare_namespace in lib/mpl_toolkits/__init__.py raises a DeprecationWarning. See also: matplotlib/matplotlib#25244 Run tests directly rather than as a subprocess so that pytest filterwarnings options have their intended effect.
I remember facing this issue few years back and the conclusion was to avoid using namespaces in general. Much safer and you do not depend on someone else which could break you. |
Per pypa/setuptools#3434 (comment) it seems we can just delete the |
See matplotlib/matplotlib#25244 and matplotlib/matplotlib#25204 Consolidate filterwarnings in pytest.ini
@tacaswell I just look the same resource on python version 3.10.10 and the excepted outcome was verified. I think that it just needs to update python to a newer version. correct me if I am wrong. Thanks |
@BabaYaga1221 The dependency is on the version of setuptools (not the version of Python). |
Until this matplotlib bug is fixed: matplotlib/matplotlib#25244 We cannot have both updated setuptools and warnings. This is because subprocesses also print out warnings, and this causes the tests to fail because of stderr output.
…mespace A lot of third party dependencies (e.g. matplotlib/matplotlib#25244) are still using it. Helpful to ignore for now.
…mespace A lot of third party dependencies (e.g. matplotlib/matplotlib#25244) are still using it. Helpful to ignore for now.
Python 3.10 remains the default, for now. Also, update CI to either disable or suppress PYTHONDEVMODE warnings from this matplotlib bug: matplotlib/matplotlib#25244
Python 3.10 remains the default, for now. Also, update CI to either disable or suppress PYTHONDEVMODE warnings from this matplotlib bug: matplotlib/matplotlib#25244
As of setuptools v67.3.0 the use of pkg_resources.declare_namespace in lib/mpl_toolkits/__init__.py raises a DeprecationWarning. See also: matplotlib/matplotlib#25244 Run tests directly rather than as a subprocess so that pytest filterwarnings options have their intended effect.
Bug summary
As of setuptools v67.3.0 the use of
pkg_resources.declare_namespace
inlib/mpl_toolkits/__init__.py
raises aDeprecationWarning
.Code for reproduction
Actual outcome
Expected outcome
No output
Additional information
See also:
https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages
https://packaging.python.org/en/latest/guides/packaging-namespace-packages/
https://peps.python.org/pep-0420/
Operating system
No response
Matplotlib Version
3.7.0
Matplotlib Backend
TkAgg
Python version
Python 3.10.9
Jupyter version
No response
Installation
conda
The text was updated successfully, but these errors were encountered: