Skip to content

Commit 693147c

Browse files
committed
fix: update Python code for 3.14 compatibility
- Add `from __future__ import annotations` to client.py and types.py - Remove quotes from forward reference type annotations - Use ruff target py313 (py314 not yet supported by ruff) Fixes CI lint failures for Python 3.14.
1 parent 75cc714 commit 693147c

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

python/numbersprotocol_capture/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Main Capture SDK client.
33
"""
44

5+
from __future__ import annotations
6+
57
import json
68
import mimetypes
79
from pathlib import Path
@@ -156,7 +158,7 @@ def __init__(
156158
self._base_url = base_url or DEFAULT_BASE_URL
157159
self._client = httpx.Client(timeout=30.0)
158160

159-
def __enter__(self) -> "Capture":
161+
def __enter__(self) -> Capture:
160162
return self
161163

162164
def __exit__(self, *args: Any) -> None:

python/numbersprotocol_capture/types.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
Type definitions for the Capture SDK.
33
"""
44

5+
from __future__ import annotations
6+
57
from dataclasses import dataclass, field
68
from pathlib import Path
79
from typing import Any
@@ -258,7 +260,7 @@ class AssetSearchResult:
258260
input_file_mime_type: str
259261
"""MIME type of the input file."""
260262

261-
similar_matches: list["SimilarMatch"]
263+
similar_matches: list[SimilarMatch]
262264
"""List of similar asset matches."""
263265

264266
order_id: str
@@ -286,7 +288,7 @@ class NftRecord:
286288
class NftSearchResult:
287289
"""Result of an NFT search operation."""
288290

289-
records: list["NftRecord"]
291+
records: list[NftRecord]
290292
"""List of NFT records found."""
291293

292294
order_id: str

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ packages = ["numbersprotocol_capture"]
6161

6262
[tool.ruff]
6363
line-length = 100
64-
target-version = "py314"
64+
target-version = "py313" # Use py313 until ruff supports py314
6565

6666
[tool.ruff.lint]
6767
select = [

0 commit comments

Comments
 (0)