Skip to content
This repository was archived by the owner on Sep 19, 2023. It is now read-only.

Commit 5152811

Browse files
committed
fix for python <3.12
1 parent e5003a2 commit 5152811

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/titiler/extensions/pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ classifiers = [
3030
]
3131
dynamic = ["version"]
3232
dependencies = [
33-
"titiler-core==2.0.0dev0"
33+
"titiler-core==2.0.0dev0",
34+
"typing-extensions; python_version < '3.12'"
3435
]
3536

3637
[project.optional-dependencies]

src/titiler/extensions/titiler/extensions/stac.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
11
"""rio-stac Extension."""
22

3-
from typing import Annotated, Any, Literal, TypedDict
3+
import sys
4+
from typing import Annotated, Any, Literal
45

56
from attrs import define
67
from fastapi import Depends, Query
78

89
from titiler.core.factory import FactoryExtension, TilerFactory
910

11+
# Ref: https://docs.pydantic.dev/2.12/errors/usage_errors/#typed-dict-version
12+
if sys.version_info >= (3, 12):
13+
from typing import TypedDict
14+
else:
15+
from typing_extensions import TypedDict
16+
1017
try:
1118
import pystac
1219
from pystac.utils import datetime_to_str, str_to_datetime

uv.lock

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)