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

fix: drop the use of pkg_resources #2187

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

12rambau
Copy link
Member

@12rambau 12rambau commented Dec 9, 2024

Fix #2186

As mentioned in the issue, pkg_resources is not part of the default Python distribution anymore so this code is failing completely at import level starting from python 3.11.

My idea in this PR is to rely on the Pathlib for path management and use the internal __file__ magic member to find back the path to the geemap folder. I didn't understand how the test were working in isolation so I'm relying on the CI to verify I didn't break anything.

geemap/conversion.py Outdated Show resolved Hide resolved
geemap/conversion.py Outdated Show resolved Hide resolved
@giswqs
Copy link
Member

giswqs commented Dec 9, 2024

Thank you for the PR. I did that for the leafmap, but forgot to do it for geemap.
https://github.com/opengeos/leafmap/pull/960/files

I used importlib.resources to replace import pkg_resources, but I think you solution should work as well.

@giswqs giswqs merged commit 737dae7 into gee-community:master Dec 9, 2024
15 checks passed
@12rambau 12rambau deleted the pkg-resource branch December 10, 2024 07:43
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.

geemap is still relying on pkg_ressource that is deprecated starting from Python 3.10
2 participants