[rasterio] 1.5.1 support (BLOCKED) - #16180
Conversation
|
@thomas-maschler I know your away from computer at the moment so won't be able to properly verify, but is this as simple a fix as it should be or is more work required? |
Affine typing| from typing import Any | ||
|
|
||
| @singledispatch | ||
| def to_json(obj: Any) -> Any: ... |
There was a problem hiding this comment.
Is there a better option than Any? Can the return type be str?
There was a problem hiding this comment.
I would like for it to be better than Any but sadly the function is brutally simple:
@singledispatch
def to_json(obj):
"""Convert obj to a JSON serializable form."""
return obj
I guess typing using an unbound Generic would be more effective @thomas-maschler?
There was a problem hiding this comment.
Nope, just looked into it a bit more and singledispatch is already typed in typeshed to tell us this so we'd basically be having a generic typing inside of typing with Callable and generic already. Looks like if we want better typing than Any the next best alternative is object so I've made that change now.
rasteriohas now released version1.5.1and as a resultaffinehas now released version3.0.0withpy.typedimplemented so we should move to properly typingAffinewith this update.BLOCKED
Currently blocked by stub_uploader not allowing affine usage. I have a PR created there that should allow this to work as can be seen here:
affineto allowlist typeshed-internal/stub_uploader#223