Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.0: pygal uses deprecated pkg_resources #535

Closed
kloczek opened this issue Apr 20, 2023 · 4 comments
Closed

3.0.0: pygal uses deprecated pkg_resources #535

kloczek opened this issue Apr 20, 2023 · 4 comments

Comments

@kloczek
Copy link

kloczek commented Apr 20, 2023

For example on testing pytest-benchmark latest pytest complains about use pkg_resources

tests/test_storage.py:169: in test_rendering
    sess.display(Namespace(
../../BUILDROOT/python-pytest-benchmark-4.0.0-3.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_benchmark/session.py:231: in display
    results_table.display(tr, self.groups, progress_reporter=progress_reporter)
../../BUILDROOT/python-pytest-benchmark-4.0.0-3.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_benchmark/table.py:135: in display
    from .histogram import make_histogram
<frozen importlib._bootstrap>:991: in _find_and_load
    ???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
    ???
<frozen importlib._bootstrap>:671: in _load_unlocked
    ???
/usr/lib/python3.8/site-packages/_pytest/assertion/rewrite.py:172: in exec_module
    exec(co, module.__dict__)
../../BUILDROOT/python-pytest-benchmark-4.0.0-3.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_benchmark/histogram.py:9: in <module>
    from pygal.graph.box import Box
/usr/lib/python3.8/site-packages/pygal/__init__.py:32: in <module>
    import pkg_resources
/usr/lib/python3.8/site-packages/pkg_resources/__init__.py:121: in <module>
    warnings.warn("pkg_resources is deprecated as an API", DeprecationWarning)
E   DeprecationWarning: pkg_resources is deprecated as an API

Here where pygal uses pkg_resources

[tkloczko@pers-jacek pygal]$ grep pkg_ -r
pygal/__init__.py:import pkg_resources
pygal/__init__.py:for entry in pkg_resources.iter_entry_points('pygal.maps'):
pygal/test/test_maps.py:import pkg_resources
pygal/test/test_maps.py:for entry in pkg_resources.iter_entry_points('pygal.test.test_maps'):
@cedk
Copy link

cedk commented Nov 6, 2023

Fixed by fd4f336

@rhpvorderman
Copy link

Can this change be included in a new release? Automated testing on github actions is failing with the following message:

     import pygal  # type: ignore
.tox/testenv/lib/python3.12/site-packages/pygal/__init__.py:32: in <module>
    import pkg_resources
E   ModuleNotFoundError: No module named 'pkg_resources'

This is for python 3.12 on ubuntu-latest.

@glepretre
Copy link
Contributor

@rhpvorderman version 3.0.1 has been released on pypi : https://pypi.org/project/pygal/3.0.1/

@rhpvorderman
Copy link

Thank you! Unfortunately I run into issue #545 now. So github automated actions are still failing on 3.12. Thanks for the prompt response. Hopefully the issue can be easily fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants