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

RFE: Replace use of pkg_resources with importlib.metadata #391

Closed
kloczek opened this issue Apr 22, 2022 · 4 comments
Closed

RFE: Replace use of pkg_resources with importlib.metadata #391

kloczek opened this issue Apr 22, 2022 · 4 comments

Comments

@kloczek
Copy link

kloczek commented Apr 22, 2022

See discussions:
astropy/astropy#11091
pypa/pip#7413

[tkloczko@devel-g2v SRPMS]$ rpm -ql python-pyparsing | grep py$ | xargs grep pkg_resources
/usr/lib/python3.8/site-packages/pyparsing/diagram/__init__.py:from pkg_resources import resource_filename
@ptmcg
Copy link
Member

ptmcg commented Apr 22, 2022

I think the suggested changes do not support back to Py3.6, which for some reason I think is still worth supporting for pyparsing (I think maybe in the next release I'll announce that pyparsing 3.1 will be released later in 2022, and will drop support for 3.6.)

But we only explicitly use pkg_resources in one place, to locate and read the jinja2 template for the railroad diagrams. This template is only about 25 lines long, I don't see a lot of harm in just in inlining it in the railroad diagram code. Then we could just cut the use of pkg_resources and not need to come up with an equivalent.

@kloczek
Copy link
Author

kloczek commented Apr 22, 2022

Hmm .. if it is some solution which may allow do the same without pkg_resources and would allow to detach pyparsing from setuptools (which part is pkg_resources) without breaking compatibility with Py3.6 I think that it would be worth to do that 🤔

@kloczek
Copy link
Author

kloczek commented Apr 22, 2022

Nevertheless seruptools developer confirmed that trying find some replacement for use pkg_resources is kind of best longer term solution pypa/setuptools#3279 (so it is nothing really-so-urgent for now)

ptmcg added a commit that referenced this issue Apr 30, 2022
@ptmcg
Copy link
Member

ptmcg commented May 10, 2022

Released in 3.0.9

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

2 participants