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

make terracotta python 3.12 compatible #346

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jkittner
Copy link

fix deprecation/removal of pkg_resources and rasterio is_tiled

if we were to drop 3.8 which is now EOL we wouldn't need the additional dependency of importlib_resources and the if/else imports.

fix deprecation/removal of pkg_resources and rasterio is_tiled
Copy link
Collaborator

@dionhaefner dionhaefner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some nits but overall this is a great contribution.

I'm fine with dropping 3.8 if you think that's easier, your call.

Comment on lines +54 to +57
if not (
src.block_shapes
and all(src.width != w for _, w in src.block_shapes)
):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a function is_tiled instead, and indicate where this code comes from (copy-paste from rasterio?)

import importlib

import terracotta.cmaps.get_cmaps

def throw_error(*args, **kwargs):
raise pkg_resources.DistributionNotFound("monkeypatched")
raise ModuleNotFoundError
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise ModuleNotFoundError
raise ModuleNotFoundError("monkeypatched")

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.

2 participants