Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ license = "MIT"
readme = "README.md"
authors = [{ name = "Kyle Barron", email = "kyle@developmentseed.org" }]
requires-python = ">=3.9"
dependencies = []
dependencies = ["typing-extensions; python_version < '3.12'"]
keywords = []
classifiers = [
"Development Status :: 4 - Beta",
Expand Down
16 changes: 11 additions & 5 deletions src/obspec/_attributes.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
from __future__ import annotations

from typing import Literal, TypeAlias
import sys
from typing import Literal, Union

Attribute: TypeAlias = (
if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias

Attribute: TypeAlias = Union[
Literal[
"Content-Disposition",
"Content-Encoding",
"Content-Language",
"Content-Type",
"Cache-Control",
]
| str
)
],
str,
]
"""Additional object attribute types.

- `"Content-Disposition"`: Specifies how the object should be handled by a browser.
Expand Down
7 changes: 6 additions & 1 deletion src/obspec/_get.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import TYPE_CHECKING, Protocol, Self, TypedDict
from typing import TYPE_CHECKING, Protocol, TypedDict

if TYPE_CHECKING:
import sys
Expand All @@ -10,6 +10,11 @@
from ._attributes import Attributes
from ._meta import ObjectMeta

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

if sys.version_info >= (3, 12):
from collections.abc import Buffer
else:
Expand Down
16 changes: 7 additions & 9 deletions src/obspec/_list.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
from __future__ import annotations

import sys
from collections.abc import Sequence
from typing import (
Generic,
Literal,
Protocol,
Self,
TypedDict,
TypeVar,
overload,
)
from typing import Generic, Literal, Protocol, TypedDict, TypeVar, overload

from ._meta import ObjectMeta
from .arrow import ArrowArrayExportable, ArrowStreamExportable

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

ListChunkType_co = TypeVar(
"ListChunkType_co",
Sequence[ObjectMeta],
Expand Down
9 changes: 7 additions & 2 deletions src/obspec/_put.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import IO, TYPE_CHECKING, Literal, Protocol, TypeAlias, TypedDict
from typing import IO, TYPE_CHECKING, Literal, Protocol, TypedDict, Union

if TYPE_CHECKING:
import sys
Expand All @@ -9,6 +9,11 @@

from ._attributes import Attributes

if sys.version_info >= (3, 10):
from typing import TypeAlias
else:
from typing_extensions import TypeAlias

if sys.version_info >= (3, 12):
from collections.abc import Buffer
else:
Expand All @@ -32,7 +37,7 @@ class UpdateVersion(TypedDict, total=False):
"""A version indicator for the newly created object."""


PutMode: TypeAlias = Literal["create", "overwrite"] | UpdateVersion
PutMode: TypeAlias = Union[Literal["create", "overwrite"], UpdateVersion]
"""Configure preconditions for the put operation

There are three modes:
Expand Down
4 changes: 4 additions & 0 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading