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
5 changes: 3 additions & 2 deletions findmy/reports/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@
import plistlib
import uuid
from abc import ABC, abstractmethod
from collections.abc import Callable
from datetime import datetime, timedelta, timezone
from functools import wraps
from typing import (
TYPE_CHECKING,
Any,
Callable,
Concatenate,
Literal,
TypedDict,
TypeVar,
Expand All @@ -24,7 +25,7 @@

import bs4
import srp._pysrp as srp
from typing_extensions import Concatenate, ParamSpec, override
from typing_extensions import ParamSpec, override

from findmy import util
from findmy.errors import (
Expand Down
4 changes: 2 additions & 2 deletions findmy/reports/anisette.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from datetime import datetime, timezone
from io import BytesIO
from pathlib import Path
from typing import BinaryIO, Literal, TypedDict, Union
from typing import BinaryIO, Literal, TypedDict

from anisette import Anisette, AnisetteHeaders
from typing_extensions import override
Expand All @@ -36,7 +36,7 @@ class LocalAnisetteMapping(TypedDict):
prov_data: str | None


AnisetteMapping = Union[RemoteAnisetteMapping, LocalAnisetteMapping]
AnisetteMapping = RemoteAnisetteMapping | LocalAnisetteMapping


def get_provider_from_mapping(
Expand Down
4 changes: 2 additions & 2 deletions findmy/reports/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import struct
from collections import defaultdict
from datetime import datetime, timedelta, timezone
from typing import TYPE_CHECKING, Literal, TypedDict, Union, overload
from typing import TYPE_CHECKING, Literal, TypedDict, overload

from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.asymmetric import ec
Expand Down Expand Up @@ -49,7 +49,7 @@ class LocationReportDecryptedMapping(TypedDict):
key: KeyPairMapping


LocationReportMapping = Union[LocationReportEncryptedMapping, LocationReportDecryptedMapping]
LocationReportMapping = LocationReportEncryptedMapping | LocationReportDecryptedMapping


class LocationReport(HasHashedPublicKey, util.abc.Serializable[LocationReportMapping]):
Expand Down
6 changes: 3 additions & 3 deletions findmy/util/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from __future__ import annotations

import random
from typing import TYPE_CHECKING, Any, Generic, TypeVar, Union
from typing import TYPE_CHECKING, Any, Generic, TypeVar

from typing_extensions import Self

Expand All @@ -14,7 +14,7 @@
from types import TracebackType

_S = TypeVar("_S", bound=Serializable)
_SC = TypeVar("_SC", bound=Union[Serializable, Closable])
_SC = TypeVar("_SC", bound=Serializable | Closable)


class _BaseSessionManager(Generic[_SC]):
Expand Down Expand Up @@ -67,7 +67,7 @@ def __exit__(
self.save()


class MixedSessionManager(_BaseSessionManager[Union[Serializable, Closable]]):
class MixedSessionManager(_BaseSessionManager[Serializable | Closable]):
"""Allows any Serializable or Closable object."""

def new(
Expand Down
6 changes: 2 additions & 4 deletions findmy/util/types.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
"""Utility types."""

from collections.abc import Coroutine
from typing import TypeVar, Union
from typing import TypeAlias, TypeVar

_T = TypeVar("_T")

# Cannot use `|` operator (PEP 604) in python 3.9,
# even with __future__ import since it is evaluated directly
MaybeCoro = Union[_T, Coroutine[None, None, _T]]
MaybeCoro: TypeAlias = _T | Coroutine[None, None, _T]
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = "Query the location of your FindMy devices with Python!"
readme = "README.md"
authors = [{ name = "Mike Almeloo", email = "git@mikealmel.ooo" }]
license-files = ["LICENSE.md"]
requires-python = ">=3.9,<3.14"
requires-python = ">=3.10,<3.15"
dependencies = [
"srp>=1.0.21,<2.0.0",
"cryptography>=42.0.0,<46.0.0",
Expand Down
Loading