Skip to content

Commit 953515c

Browse files
authored
fix: typing (#110)
1 parent ea38cc8 commit 953515c

File tree

5 files changed

+43
-53
lines changed

5 files changed

+43
-53
lines changed

.github/workflows/ci.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
fail-fast: false
2626
matrix:
2727
python-version:
28-
- "3.10"
2928
- "3.11"
3029
- "3.12"
3130
- "3.13"

.github/workflows/pypi.yaml

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,45 +19,33 @@ jobs:
1919
runs-on: ubuntu-22.04
2020
strategy:
2121
matrix:
22-
maturin:
23-
- args: "-i 3.10"
24-
name: python-310
25-
- args: "-i 3.11 -F pyo3/abi3-py311"
26-
name: python-311+
2722
platform:
2823
- target: x86_64
2924
manylinux: auto
30-
duckdb-slug: amd64
3125
- target: aarch64
3226
manylinux: "2_28"
33-
duckdb-slug: aarch64
3427
steps:
3528
- uses: actions/checkout@v4
3629
- uses: astral-sh/setup-uv@v5
3730
- name: Install Python
38-
run: uv python install 3.10
31+
run: uv python install 3.11
3932
- name: Build wheels
4033
uses: PyO3/maturin-action@v1
4134
with:
4235
target: ${{ matrix.platform.target }}
43-
args: --release --out dist ${{ matrix.maturin.args }} -F duckdb-bundled
36+
args: --release --out dist -i 3.11 -F pyo3/abi3-py311 -F duckdb-bundled
4437
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
4538
manylinux: ${{ matrix.platform.manylinux }}
4639
- name: Upload wheels
4740
uses: actions/upload-artifact@v4
4841
with:
49-
name: wheels-linux-${{ matrix.platform.target }}-${{ matrix.maturin.name }}
42+
name: wheels-linux-${{ matrix.platform.target }}
5043
path: dist
5144

5245
macos:
5346
runs-on: ${{ matrix.platform.runner }}
5447
strategy:
5548
matrix:
56-
maturin:
57-
- args: "-i 3.10"
58-
name: python-310
59-
- args: "-i 3.11 -F pyo3/abi3-py311"
60-
name: python-311+
6149
platform:
6250
- runner: macos-13
6351
target: x86_64
@@ -67,17 +55,17 @@ jobs:
6755
- uses: actions/checkout@v4
6856
- uses: astral-sh/setup-uv@v5
6957
- name: Install Python
70-
run: uv python install 3.10
58+
run: uv python install 3.11
7159
- name: Build wheels
7260
uses: PyO3/maturin-action@v1
7361
with:
7462
target: ${{ matrix.platform.target }}
75-
args: --release --out dist ${{ matrix.maturin.args }} -F duckdb-bundled
63+
args: --release --out dist -i 3.11 -F pyo3/abi3-py311 -F duckdb-bundled
7664
sccache: ${{ !startsWith(github.ref, 'refs/tags/') }}
7765
- name: Upload wheels
7866
uses: actions/upload-artifact@v4
7967
with:
80-
name: wheels-macos-${{ matrix.platform.target }}-${{ matrix.maturin.name }}
68+
name: wheels-macos-${{ matrix.platform.target }}
8169
path: dist
8270

8371
sdist:

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1919
- Deterministic asset ordering ([rustac #709](https://github.com/stac-utils/rustac/pull/709), [#93](https://github.com/stac-utils/rustac-py/pull/93))
2020
- Normalize search output ([#102](https://github.com/stac-utils/rustac-py/pull/102))
2121

22+
### Removed
23+
24+
- Python 3.10 support ([#110](https://github.com/stac-utils/rustac-py/pull/110))
25+
2226
## [0.6.0] - 2025-04-18
2327

2428
> [!NOTE]

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@ name = "rustac"
33
description = "The power of Rust for the Python STAC ecosystem"
44
readme = "README.md"
55
authors = [{ name = "Pete Gadomski", email = "[email protected]" }]
6-
requires-python = ">=3.10"
6+
requires-python = ">=3.11"
77
classifiers = [
88
"Development Status :: 4 - Beta",
99
"Intended Audience :: Science/Research",
1010
"License :: OSI Approved :: Apache Software License",
1111
"License :: OSI Approved :: MIT License",
1212
"Natural Language :: English",
13-
"Programming Language :: Python :: 3.10",
1413
"Programming Language :: Python :: 3.11",
1514
"Programming Language :: Python :: 3.12",
1615
"Programming Language :: Python :: 3.13",

python/rustac/__init__.py

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,74 @@
11
from __future__ import annotations
22

33
from .rustac import *
4-
from typing import TypedDict
4+
from typing import TypedDict, Required, Any, Literal
55

66

7-
class Catalog(TypedDict):
7+
class Catalog(TypedDict, total=False):
88
"""A STAC Catalog object represents a logical group of other Catalog, Collection, and Item objects."""
99

10-
type: str
10+
type: Required[str]
1111
"""Set to Catalog if this Catalog only implements the Catalog spec."""
1212

13-
stac_version: str
13+
stac_version: Required[str]
1414
"""The STAC version the Catalog implements."""
1515

1616
stac_extensions: list[str] | None
1717
"""A list of extension identifiers the Catalog implements."""
1818

19-
id: str
19+
id: Required[str]
2020
"""Identifier for the Catalog."""
2121

2222
title: str | None
2323
"""A short descriptive one-line title for the Catalog."""
2424

25-
description: str
25+
description: Required[str]
2626
"""Detailed multi-line description to fully explain the Catalog.
2727
2828
CommonMark 0.29 syntax MAY be used for rich text representation."""
2929

30-
links: list[Link]
30+
links: Required[list[Link]]
3131
"""A list of references to other documents."""
3232

33-
class Collection(TypedDict):
33+
class Collection(TypedDict, total=False):
3434
"""The STAC Collection Specification defines a set of common fields to describe a group of Items that share properties and metadata."""
3535

36-
type: str
36+
type: Required[str]
3737
"""Must be set to Collection to be a valid Collection."""
3838

39-
stac_version: str
39+
stac_version: Required[str]
4040
"""The STAC version the Collection implements."""
4141

4242
stac_extensions: list[str] | None
4343
"""A list of extension identifiers the Collection implements."""
4444

45-
id: str
45+
id: Required[str]
4646
"""Identifier for the Collection that is unique across all collections in the root catalog."""
4747

4848
title: str | None
4949
"""A short descriptive one-line title for the Collection."""
5050

51-
description: str
51+
description: Required[str]
5252
"""Detailed multi-line description to fully explain the Collection.
5353
5454
CommonMark 0.29 syntax MAY be used for rich text representation."""
5555

5656
keywords: list[str] | None
5757
"""List of keywords describing the Collection."""
5858

59-
license: str
59+
license: Required[str]
6060
"""License(s) of the data collection as SPDX License identifier, SPDX License expression, or `other`."""
6161

6262
providers: list[Provider] | None
6363
"""A list of providers, which may include all organizations capturing or processing the data or the hosting provider."""
6464

65-
extent: Extent
65+
extent: Required[Extent]
6666
"""Spatial and temporal extents."""
6767

68-
summaries: dict[str, Any]
68+
summaries: dict[str, Any] | None
6969
"""A map of property summaries, either a set of values, a range of values or a JSON Schema."""
7070

71-
links: list[Link]
71+
links: Required[list[Link]]
7272
"""A list of references to other documents."""
7373

7474
assets: dict[str, Asset] | None
@@ -77,10 +77,10 @@ class Collection(TypedDict):
7777
item_assets: dict[str, ItemAsset] | None
7878
"""A dictionary of assets that can be found in member Items."""
7979

80-
class Provider(TypedDict):
80+
class Provider(TypedDict, total=False):
8181
"""A provider is any of the organizations that captures or processes the content of the Collection and therefore influences the data offered by this Collection."""
8282

83-
name: str
83+
name: Required[str]
8484
"""The name of the organization or the individual."""
8585

8686
description: str | None
@@ -93,7 +93,7 @@ class Provider(TypedDict):
9393
| Literal["producer"]
9494
| Literal["processor"]
9595
| Literal["host"]
96-
]
96+
] | None
9797
"""Roles of the provider."""
9898

9999
url: str | None
@@ -120,7 +120,7 @@ class TemporalExtent(TypedDict):
120120
bbox: list[list[str | None]]
121121
"""Potential temporal extents covered by the Collection."""
122122

123-
class ItemAsset(TypedDict):
123+
class ItemAsset(TypedDict, total=False):
124124
"""An Item Asset Object defined at the Collection level is nearly the same as the Asset Object in Items, except for two differences.
125125
126126
The href field is not required, because Item Asset Definitions don't point to any data by themselves, but at least two other fields must be present."""
@@ -139,19 +139,19 @@ class ItemAsset(TypedDict):
139139
roles: list[str] | None
140140
"""The semantic roles of the asset, similar to the use of rel in links."""
141141

142-
class Item(TypedDict):
142+
class Item(TypedDict, total=False):
143143
"""An Item is a GeoJSON Feature augmented with foreign members relevant to a STAC object."""
144144

145-
type: str
145+
type: Required[str]
146146
"""Type of the GeoJSON Object. MUST be set to Feature."""
147147

148-
stac_version: str
148+
stac_version: Required[str]
149149
"""The STAC version the Item implements."""
150150

151151
stac_extensions: list[str] | None
152152
"""A list of extensions the Item implements."""
153153

154-
id: str
154+
id: Required[str]
155155
"""Provider identifier. The ID should be unique within the Collection that contains the Item."""
156156

157157
geometry: dict[str, Any] | None
@@ -162,15 +162,15 @@ class Item(TypedDict):
162162
163163
Bounding Box of the asset represented by this Item, formatted according to RFC 7946, section 5."""
164164

165-
properties: Properties
165+
properties: Required[Properties]
166166
"""A dictionary of additional metadata for the Item."""
167167

168-
links: list[Link]
168+
links: Required[list[Link]]
169169
"""List of link objects to resources and related URLs.
170170
171171
See the best practices for details on when the use self links is strongly recommended."""
172172

173-
assets: dict[str, Asset]
173+
assets: Required[dict[str, Asset]]
174174
"""Dictionary of asset objects that can be downloaded, each with a unique key."""
175175

176176
collection: str | None
@@ -186,19 +186,19 @@ class Properties(TypedDict):
186186
187187
It is formatted according to RFC 3339, section 5.6. null is allowed, but requires start_datetime and end_datetime from common metadata to be set."""
188188

189-
class Link(TypedDict):
189+
class Link(TypedDict, total=False):
190190
"""This object describes a relationship with another entity.
191191
192192
Data providers are advised to be liberal with the links section, to describe
193193
things like the Catalog an Item is in, related Items, parent or child Items
194194
(modeled in different ways, like an 'acquisition' or derived data)."""
195195

196-
href: str
196+
href: Required[str]
197197
"""The actual link in the format of an URL.
198198
199199
Relative and absolute links are both allowed. Trailing slashes are significant."""
200200

201-
rel: str
201+
rel: Required[str]
202202
"""Relationship between the current document and the linked document."""
203203

204204
type: str | None
@@ -218,12 +218,12 @@ class Link(TypedDict):
218218
body: Any | None
219219
"""The HTTP body to be sent to the target resource."""
220220

221-
class Asset(TypedDict):
221+
class Asset(TypedDict, total=False):
222222
"""An Asset is an object that contains a URI to data associated with the Item that can be downloaded or streamed.
223223
224224
It is allowed to add additional fields."""
225225

226-
href: str
226+
href: Required[str]
227227
"""URI to the asset object. Relative and absolute URI are both allowed. Trailing slashes are significant."""
228228

229229
title: str | None

0 commit comments

Comments
 (0)