-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Setuptools should not rely on pkg_resources #3085
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
Comments
This somehow breaks projects entry points to pyramid/paste it seems, which aren't able to find their entry point anymore (I have no idea what's the cause) Error for Google:
|
The same pr causes this issue I think #3102 |
Now that the setuptools code base no longer depends on pkg_resources, I'm considering once again republishing pkg_resources as a separate package. I've reactivated the pypa/pkg_resources repo and re-run a filter operation on this repo to re-capture the history of that code there:
I'm now pondering publishing that code to see if the setuptools tests can continue to run by requiring that package at test time. |
Attempting to remove pkg_resources, the pbr tests fail with this traceback:
It seems that pbr is reliant on the interface. |
pbr uses pkg_resources in exactly one place, to evaluate markers. That's definitely a deprecated use and superseded by 'importlib.metadata' and 'packaging'. |
I tried uploading a copy of
I don't think it's worth trying to reclaim that name, so I'm going to assume that supplying a separate |
It is a bit unfortunate that we cannot publish to PyPI. I can see a couple of situations in which it would be useful. If we want to be very conservative and try to reduce backwards incompatibility we could:
|
Does the project need to be named You're right that replacing the deprecated APIs isn't an issue, at least not for actively maintained projects. What I'm a bit concerned about is unnecessarily breaking those which haven't received an update in a while. Especially in larger projects those dependencies aren't always avoidable. For Home Assistant we had a similar situation with the move to Python 3.13. The removal of stdlib modules broke a lot of packages. We wouldn't be able to use 3.13 now if it weren't for backport packages. I'd assume it will be similar for the |
To be sure, if there's a common/impactful scenario where the presence of a backfill project would help, I'll definitely work on creating that project. The problem is that the scenarios I've thought of where it might help would be just as easily addressed by pinning Setuptools. After all, if you can require or install pkg_resources, that's the point where you could also require setuptools<81, no? The dependency is at runtime and not build time, so the complications that come with being a build time dependency are moot, I think. If users are noticing the warning now, let's explore those cases and see what options are available. |
Yes, though I'd prefer to not have to do that as it "forever" limits which setuptools version is used. There might be other packages in the future which depend on a newer version and would thus be incompatible. "forever" might be an exaggeration but some packages might not have received an update in over 3 years. Those are unlikely to get fixed. So the setuptools pin would have to stay until these are eventually removed.
If it were a build time dependency, I don't think there is an option to remove it. Thankfully this shouldn't be the case (?). Yes |
Acknowledged. And if there's a scenario that warrants this bridge, we'll deal with it then. |
This issue basically tracks the root goal of obviating pkg_resources, in particular that Setuptools depends on it.
Over the past few years, myself and others have worked hard to create
importlib.resources
andimportlib.metadata
in the goal of superseding pkg_resources. These libraries are now very stable and replacing much of the functionality provided by pkg_resources.In python/importlib_metadata#38, I examined the setuptools package to determine its level of dependency on pkg_resources. Unsurprisingly, there is a diverse set of interfaces on which setuptools relies.
Nevertheless, this project should work toward Setuptools adopting the importlib features in place of pkg_resources.
The text was updated successfully, but these errors were encountered: