glue-viz / glue

Linked Data Visualizations Across Multiple Files
http://glueviz.org
Other
740 stars 153 forks source link

BUG: importing glue with setuptools>=67.3 raises a DeprecationWarning #2364

Closed neutrinoceros closed 1 year ago

neutrinoceros commented 1 year ago

Describe the bug pkg_resources.get_distribution was changed in setuptools 67.3, released last week, and now raises a deprecation warning on import.

pkg_resources as a whole is legacy and should be avoided, in particular because it creates a de facto runtime dependency on setuptools, which is currently undeclared.

To Reproduce

python -m venv venv
source venv/bin/activate
python -m pip install --upgrade setuptools
python -m pip install glue
python -Werror -c "import glue"

output

...
DeprecationWarning: Deprecated call to `pkg_resources.declare_namespace('mpl_toolkits')`.
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

Expected behavior should return without error

Details:

I should be able to patch pkg_resources out completely.

neutrinoceros commented 1 year ago

Note that the warning I pasted is from mpl_toolkit, not glue, but glue would cause it on its own because it's also using pkg_resources.get_distribution. For reference the issue has been reported upstream too as https://github.com/matplotlib/matplotlib/issues/25244