Skip to content

Commit fabec26

Browse files
committed
ENH: switch mpl_toolkits to implicit namespace package (PEP 420)
1 parent 32b6ebb commit fabec26

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
``matplotlib.mpl_toolkits`` is now an implicit namespace package
2+
----------------------------------------------------------------
3+
4+
Following the deprecation of ``pkg_resources.declare_namespace`` in ``setuptools`` 67.3.0,
5+
``matplotlib.mpl_toolkits`` is now implemented as an implicit namespace, following
6+
`PEP 420 <https://peps.python.org/pep-0420/>`_.
7+
8+
This change should be backward compatible. In case of problems please `file an issue on GitHub
9+
<https://github.com/matplotlib/matplotlib/issues/new/choose>`_.

lib/mpl_toolkits/__init__.py

-4
This file was deleted.

setup.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
import shutil
3030
import subprocess
3131

32-
from setuptools import setup, find_packages, Distribution, Extension
32+
from setuptools import setup, find_namespace_packages, Distribution, Extension
3333
import setuptools.command.build_ext
3434
import setuptools.command.build_py
3535
import setuptools.command.sdist
@@ -300,8 +300,7 @@ def make_release_tree(self, base_dir, files):
300300
],
301301

302302
package_dir={"": "lib"},
303-
packages=find_packages("lib"),
304-
namespace_packages=["mpl_toolkits"],
303+
packages=find_namespace_packages(where="lib"),
305304
py_modules=["pylab"],
306305
# Dummy extension to trigger build_ext, which will swap it out with
307306
# real extensions that can depend on numpy for the build.

0 commit comments

Comments
 (0)