Skip to content

Commit ec82589

Browse files
committed
DEPS: use importlib for backend discovery pandas-dev#41815
1 parent 80ca9d4 commit ec82589

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

doc/source/getting_started/install.rst

-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ Visualization
262262
========================= ================== =============================================================
263263
Dependency Minimum Version Notes
264264
========================= ================== =============================================================
265-
setuptools 38.6.0 Utils for entry points of plotting backend
266265
matplotlib 3.3.2 Plotting library
267266
Jinja2 2.11 Conditional formatting with DataFrame.style
268267
tabulate 0.8.7 Printing in Markdown-friendly format (see `tabulate`_)

doc/source/whatsnew/v1.4.0.rst

-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ If installed, we now require:
8282
+-----------------+-----------------+----------+---------+
8383
| mypy (dev) | 0.910 | | X |
8484
+-----------------+-----------------+----------+---------+
85-
| setuptools | 38.6.0 | | |
86-
+-----------------+-----------------+----------+---------+
8785

8886
For `optional libraries <https://pandas.pydata.org/docs/getting_started/install.html>`_ the general recommendation is to use the latest version.
8987
The following table lists the lowest version per library that is currently being tested throughout the development of pandas.

pandas/plotting/_core.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ def _load_backend(backend: str) -> types.ModuleType:
17431743
types.ModuleType
17441744
The imported backend.
17451745
"""
1746-
import pkg_resources
1746+
from importlib.metadata import entry_points
17471747

17481748
if backend == "matplotlib":
17491749
# Because matplotlib is an optional dependency and first-party backend,
@@ -1759,7 +1759,8 @@ def _load_backend(backend: str) -> types.ModuleType:
17591759

17601760
found_backend = False
17611761

1762-
for entry_point in pkg_resources.iter_entry_points("pandas_plotting_backends"):
1762+
eps = entry_points()
1763+
for entry_point in eps.get("pandas_plotting_backends"):
17631764
found_backend = entry_point.name == backend
17641765
if found_backend:
17651766
module = entry_point.load()

0 commit comments

Comments
 (0)