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

package 'pkg_resource' is deprecated in favor of importlib #23899

Open
sebastianliebscher opened this issue May 2, 2023 · 7 comments
Open

package 'pkg_resource' is deprecated in favor of importlib #23899

sebastianliebscher opened this issue May 2, 2023 · 7 comments
Labels
#bug Bug report

Comments

@sebastianliebscher
Copy link
Contributor

The package pkg_resource is officially deprecated in favor of importlib: https://setuptools.pypa.io/en/latest/pkg_resources.html

Use of pkg_resources is discouraged in favor of importlib.resources, importlib.metadata, and their backports (resources, metadata). Please consider using those libraries instead of pkg_resources.

@sebastianliebscher
Copy link
Contributor Author

I think this issue is fixed when part 2 of #24578 gets merged @cwegener

@cwegener
Copy link
Contributor

I still have one last step to go before this is complete, which is to change the UPLOAD_FOLDER logic in superset.config which currently relies on said setuptools module.

The won't be any ceremonious removal of the setuptools runtime dependency from the requires list though, as that runtime dependency is not explicitly declared in the metadata at all anyway. But instead superset simply presumes that setuptools is a runtime dependency that is installed everywhere.

@rusackas
Copy link
Member

rusackas commented Mar 6, 2024

@cwegener @sebastianliebscher can you advise us on the current status of this one?

@cwegener
Copy link
Contributor

cwegener commented Mar 7, 2024

UPLOAD_FOLDER logic still needs to be changed in order to get rid of this last remaining pkg_resources import ...

BASE_DIR = pkg_resources.resource_filename("superset", "")

It's an easy change to do, but will be a breaking change.

I'll create a PR for it.

@rusackas
Copy link
Member

rusackas commented Mar 7, 2024

We can slap a HOLD label on it, and line up the shot for an eventual 5.0 :D

@cwegener
Copy link
Contributor

cwegener commented Mar 7, 2024

We can slap a HOLD label on it, and line up the shot for an eventual 5.0 :D

Sounds good to me.

@rusackas rusackas moved this to Proposals - Not proposed for consensus in Apache Superset 5.0 Sep 11, 2024
@rusackas
Copy link
Member

rusackas commented Oct 1, 2024

Hey @cwegener - long time no talk :)

We're getting close to 5.0 now, so I'd say feel free to open a PR if/when you have bandwidth. We're at the phase where proposals/consensus will be coming through, and merging these in-progress/held-back things won't be far behind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug Bug report
Projects
Status: Proposals - Not proposed for consensus
Development

Successfully merging a pull request may close this issue.

4 participants
@rusackas @cwegener @sebastianliebscher and others