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

pkg_resources is deprecated #763

Open
rolandmas opened this issue Oct 22, 2024 · 6 comments
Open

pkg_resources is deprecated #763

rolandmas opened this issue Oct 22, 2024 · 6 comments

Comments

@rolandmas
Copy link

Hello, your friendly Debian package maintainier here. It's been brought to my attention that the pkg_resources module is deprecated (see https://setuptools.pypa.io/en/latest/pkg_resources.html); this led to a bug report in the Debian PTS (see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1083524), which I'd like to submit to you. I don't think there's any emergency at this point, but this should be fixed before the module in question is actually removed :-)

@borondics
Copy link
Member

@rolandmas, thanks for the note!

@markotoplak, as far as I can see pkg_resources is only used in the PLS widget in orange-spectroscopy? If this is going to move to orange3 maybe we can just remove the widget altogether?

@markotoplak
Copy link
Collaborator

@borondics, version checks are easy.

The problem is the namespace package orangecontrib we use. There we need to be a little more careful. Some notes: https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-namespace-packages

@stuart-cls
Copy link
Member

I think I got this working without pkg_resources (and pure pyproject.toml config) in https://github.com/Quasars/orange-spectroscopy-prototypes/tree/2024.11.14 ). We can test it there first in case I missed some 🤦 bugs :)

@markotoplak
Copy link
Collaborator

@rolandmas, are pkg_resources really a problem if the package explicitly requires setuptools, as is the case here?

The problem here is that a lot (almost all) orangecontrib packages use the legacy pkg_resources style of namespace packages. If I try changing styles, it still seems to work, but https://packaging.python.org/en/latest/guides/packaging-namespace-packages strongly discourages mixing namespace packaging styles. Therefore, for now, I'd stick to explicitly requiring setuptools. Is that a problem?

I did remove its other uses though.

@markotoplak
Copy link
Collaborator

I completely removed pkg_resources in #782, but am afraid to merge it for possible incompatibilities with other add-ons.

@stuart-cls
Copy link
Member

@markotoplak I haven't seen any big incompatibilities with orange-spectroscopy-prototypes (no pkg_resources) and this add-on (with pkg_resources) but we're not currently shipping any widgets in protospec so maybe it's not a good test. I did notice some funny behaviour when uninstalling the package, pip didn't seem to be sure files belonged to which package. But it still worked fine.

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