From d1d02c69891ddd5367903ea0bb11d260c3cac219 Mon Sep 17 00:00:00 2001 From: Julien Sanchez Date: Sun, 19 Nov 2023 18:53:32 +0100 Subject: [PATCH] Use `importlib_metadata` instead of `importlib.metadata` Make it backward compatible with every supported Python version. Could be a fix to #545. --- pygal/__init__.py | 3 ++- pygal/test/test_maps.py | 2 +- tox.ini | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pygal/__init__.py b/pygal/__init__.py index 8cf6b7b1..3a1bc582 100644 --- a/pygal/__init__.py +++ b/pygal/__init__.py @@ -28,7 +28,8 @@ import sys import traceback import warnings -from importlib.metadata import entry_points + +from importlib_metadata import entry_points from pygal import maps from pygal.config import Config diff --git a/pygal/test/test_maps.py b/pygal/test/test_maps.py index 2ad54027..ed069586 100644 --- a/pygal/test/test_maps.py +++ b/pygal/test/test_maps.py @@ -18,7 +18,7 @@ # along with pygal. If not, see . """Map plugins tests are imported here""" -from importlib.metadata import entry_points +from importlib_metadata import entry_points # Load plugins tests for entry in entry_points(group="pygal.test.test_maps"): diff --git a/tox.ini b/tox.ini index 83cabf46..9801e051 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,7 @@ deps = lxml pyquery cairosvg + importlib_metadata setenv = COVERAGE_FILE=.cov-{envname}