Skip to content

Commit 2c71ca1

Browse files
authored
Merge pull request #203 from malmeloo/feat/support-python-3.14
feat!: update Python support range to [3.10, 3.15)
2 parents 8a4126b + 59a55e0 commit 2c71ca1

File tree

7 files changed

+116
-305
lines changed

7 files changed

+116
-305
lines changed

findmy/reports/account.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@
99
import plistlib
1010
import uuid
1111
from abc import ABC, abstractmethod
12+
from collections.abc import Callable
1213
from datetime import datetime, timedelta, timezone
1314
from functools import wraps
1415
from typing import (
1516
TYPE_CHECKING,
1617
Any,
17-
Callable,
18+
Concatenate,
1819
Literal,
1920
TypedDict,
2021
TypeVar,
@@ -24,7 +25,7 @@
2425

2526
import bs4
2627
import srp._pysrp as srp
27-
from typing_extensions import Concatenate, ParamSpec, override
28+
from typing_extensions import ParamSpec, override
2829

2930
from findmy import util
3031
from findmy.errors import (

findmy/reports/anisette.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from datetime import datetime, timezone
1313
from io import BytesIO
1414
from pathlib import Path
15-
from typing import BinaryIO, Literal, TypedDict, Union
15+
from typing import BinaryIO, Literal, TypedDict
1616

1717
from anisette import Anisette, AnisetteHeaders
1818
from typing_extensions import override
@@ -36,7 +36,7 @@ class LocalAnisetteMapping(TypedDict):
3636
prov_data: str | None
3737

3838

39-
AnisetteMapping = Union[RemoteAnisetteMapping, LocalAnisetteMapping]
39+
AnisetteMapping = RemoteAnisetteMapping | LocalAnisetteMapping
4040

4141

4242
def get_provider_from_mapping(

findmy/reports/reports.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import struct
1010
from collections import defaultdict
1111
from datetime import datetime, timedelta, timezone
12-
from typing import TYPE_CHECKING, Literal, TypedDict, Union, overload
12+
from typing import TYPE_CHECKING, Literal, TypedDict, overload
1313

1414
from cryptography.hazmat.backends import default_backend
1515
from cryptography.hazmat.primitives.asymmetric import ec
@@ -49,7 +49,7 @@ class LocationReportDecryptedMapping(TypedDict):
4949
key: KeyPairMapping
5050

5151

52-
LocationReportMapping = Union[LocationReportEncryptedMapping, LocationReportDecryptedMapping]
52+
LocationReportMapping = LocationReportEncryptedMapping | LocationReportDecryptedMapping
5353

5454

5555
class LocationReport(HasHashedPublicKey, util.abc.Serializable[LocationReportMapping]):

findmy/util/session.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
import random
6-
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Union
6+
from typing import TYPE_CHECKING, Any, Generic, TypeVar
77

88
from typing_extensions import Self
99

@@ -14,7 +14,7 @@
1414
from types import TracebackType
1515

1616
_S = TypeVar("_S", bound=Serializable)
17-
_SC = TypeVar("_SC", bound=Union[Serializable, Closable])
17+
_SC = TypeVar("_SC", bound=Serializable | Closable)
1818

1919

2020
class _BaseSessionManager(Generic[_SC]):
@@ -67,7 +67,7 @@ def __exit__(
6767
self.save()
6868

6969

70-
class MixedSessionManager(_BaseSessionManager[Union[Serializable, Closable]]):
70+
class MixedSessionManager(_BaseSessionManager[Serializable | Closable]):
7171
"""Allows any Serializable or Closable object."""
7272

7373
def new(

findmy/util/types.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
"""Utility types."""
22

33
from collections.abc import Coroutine
4-
from typing import TypeVar, Union
4+
from typing import TypeAlias, TypeVar
55

66
_T = TypeVar("_T")
77

8-
# Cannot use `|` operator (PEP 604) in python 3.9,
9-
# even with __future__ import since it is evaluated directly
10-
MaybeCoro = Union[_T, Coroutine[None, None, _T]]
8+
MaybeCoro: TypeAlias = _T | Coroutine[None, None, _T]

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description = "Query the location of your FindMy devices with Python!"
55
readme = "README.md"
66
authors = [{ name = "Mike Almeloo", email = "[email protected]" }]
77
license-files = ["LICENSE.md"]
8-
requires-python = ">=3.9,<3.14"
8+
requires-python = ">=3.10,<3.15"
99
dependencies = [
1010
"srp>=1.0.21,<2.0.0",
1111
"cryptography>=42.0.0,<46.0.0",

0 commit comments

Comments
 (0)