Skip to content

Remove pkg_resources usage #105

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gforcada
Copy link

@gforcada gforcada commented Mar 3, 2025

Starting in Python 3.13 it gets more and more complicated to keep using pkg_resources.

Fortunately, importlib.metadata, importlib.resources and packaging took over the functionality from it.

I did not clean up pkg_resources traces from urlparser.py as they are all conditional, nor I removed it on __init__.py as that needs to be coordinated with all other distributions that share the paste namespace.

There are a few other leftovers that I'm not 100% sure you want to delete... so take this as an open floor to discuss the future of the code paths were pkg_resources is involved :)

@cdent
Copy link
Collaborator

cdent commented Mar 3, 2025

Is plone still actively using paste?

My hope for a long time has been that we could retire paste out of existence. This is why things like pkg_resources use hasn't had any significant attention, despite knowing it would become an issue. It could be a forcing function to get people off paste and all of its derivations (postscript, pastedeploy, etc).

So I'm conflicted. If there are people willing to do the cleanup work, great, we can keep making releases. But if not...

@gforcada
Copy link
Author

gforcada commented Mar 4, 2025

From a quick search, Zope, zope.publisher, diazo and plone.recipe.zope2instance are still using Paste.

The last two are on their way out of Plone core, but I'm not sure what's the story for Zope and zope.publisher.

What would be the alternative to replace Paste with? for pkg_resources one has to migrate to importlib.metadata/importlib.resources/packaging. What would be the replacement for Paste? 🤔

We can try to migrate to something else and thus avoid having to touch Paste 👍🏾

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

Successfully merging this pull request may close these issues.

2 participants