3.0.1 switched to a deprecated `importlib.metadata` API that's removed in Python 3.12
Nobody has claimed this yet.
- #546 by @akx — closed without merging
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- python
- Domain
- data-visualization
Research direction
Start in pygal/init.py, where entry_points() is used while loading map plugins, and review the compatibility note for importlib.metadata. Run tox -e py312 and the tests under pygal/test first. Done means the Python 3.12 test run no longer raises the EntryPoints.get() error and the existing tests pass.
Written by the indexing model from the issue text.
Description
The 3.0.1 version switches from pkg_resources to importlib.metadata. However, it uses the deprecate pre-3.10 API that doesn't work with Python 3.12 anymore:
$ tox -e py312
.pkg: _optional_hooks> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_sdist> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: get_requires_for_build_wheel> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: prepare_metadata_for_build_wheel> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
.pkg: build_sdist> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py312: install_package> python -I -m pip install --force-reinstall --no-deps /tmp/pygal/.tox/.tmp/package/5/pygal-3.0.1.tar.gz
py312: commands[0]> coverage run --source=pygal /tmp/pygal/.tox/py312/bin/py.test pygal/test --junitxml=junit-py312.xml --flake8
ImportError while loading conftest '/tmp/pygal/pygal/test/conftest.py'.
pygal/__init__.py:64: in <module>
for entry in entry_points().get('pygal.maps', ()):
E AttributeError: 'EntryPoints' object has no attribute 'get'
py312: exit 4 (0.93 seconds) /tmp/pygal> coverage run --source=pygal /tmp/pygal/.tox/py312/bin/py.test pygal/test --junitxml=junit-py312.xml --flake8 pid=149296
.pkg: _exit> python /usr/lib/python3.12/site-packages/pyproject_api/_backend.py True setuptools.build_meta __legacy__
py312: FAIL code 4 (7.79=setup[6.86]+cmd[0.93] seconds)
evaluation failed :( (7.91 seconds)
See "compatibility note" at the bottom of:
https://docs.python.org/3.11/library/importlib.metadata.html#entry-points
For compatibility, if no parameters are passed to entry_points, a
SelectableGroupsobject is returned, implementing that dict interface. In the future, callingentry_pointswith no parameters will return anEntryPointsobject. Users should rely on the selection interface to retrieve entry points by group.
This is what happens in 3.12, so .get() is no longer valid.
- Dominant language
- Python
- Stars
- 2.8k
- Forks
- 419
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Kozea/pygal
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 52/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
Techiebutler/freeframe#687 ·
Maintainers usually reply within 1 day
-
bug verbose GC
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
IBM/javacore-analyser#677 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Maintainers usually reply within 2 days
-
area/config comp/plugins P1 platform/qqbot tool/file type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
NousResearch/hermes-agent#163932 · 1 comment ·
Maintainers usually reply within 1 day
-
plugins/dsh: todayStr() computes UTC but is documented as local — journal entries written 00:00–08:00 local land in the previous day's filePossibly taken @Beehtrix claimed this today. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
zilliztech/memsearch#907 · 1 comment ·
Maintainers usually reply within 1 day