Skip to content

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 👍🏾

@mauritsvanrees
Copy link

In Plone/Zope we have concluded that we are not using any of the parts of Paste that need pkg_resources. And any usage of pkg_resources in Paste has conveniently been made conditional last year, catching a possible ImportError, so that helps. Thanks!

So I suppose this PR could be closed. But maybe someone else wants to continue on this, or use this as a starting point.

@cdent
Copy link
Collaborator

cdent commented Nov 14, 2025

Thanks for doing that research. I agree that keeping this around in case someone else wants to pick it up is a good idea. I'll convert it to a draft for now rather than closing it, to keep it visible.

@cdent cdent marked this pull request as draft November 14, 2025 13:05
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.

3 participants