mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-06 22:07:19 +02:00
236 lines
7.5 KiB
Diff
236 lines
7.5 KiB
Diff
--- a/psycopg/psycopg/_compat.py
|
|
+++ b/psycopg/psycopg/_compat.py
|
|
@@ -8,15 +8,10 @@ import sys
|
|
import asyncio
|
|
from typing import Any, Awaitable, Generator, Optional, Sequence, Union, TypeVar
|
|
|
|
-# NOTE: TypeAlias cannot be exported by this module, as pyright special-cases it.
|
|
-# For this raisin it must be imported directly from typing_extension where used.
|
|
-# See https://github.com/microsoft/pyright/issues/4197
|
|
-from typing_extensions import TypeAlias
|
|
-
|
|
if sys.version_info >= (3, 8):
|
|
- from typing import Protocol
|
|
+ from typing import Protocol, TypeAlias
|
|
else:
|
|
- from typing_extensions import Protocol
|
|
+ from typing import Protocol
|
|
|
|
T = TypeVar("T")
|
|
FutureT: TypeAlias = Union["asyncio.Future[T]", Generator[Any, None, T], Awaitable[T]]
|
|
@@ -52,12 +47,12 @@ else:
|
|
if sys.version_info >= (3, 10):
|
|
from typing import TypeGuard
|
|
else:
|
|
- from typing_extensions import TypeGuard
|
|
+ from typing import TypeGuard
|
|
|
|
if sys.version_info >= (3, 11):
|
|
from typing import LiteralString, Self
|
|
else:
|
|
- from typing_extensions import LiteralString, Self
|
|
+ from typing import LiteralString, Self
|
|
|
|
__all__ = [
|
|
"Counter",
|
|
--- a/psycopg_pool/psycopg_pool/_compat.py
|
|
+++ b/psycopg_pool/psycopg_pool/_compat.py
|
|
@@ -6,8 +6,7 @@ compatibility functions for different Py
|
|
|
|
import sys
|
|
import asyncio
|
|
-from typing import Any, Awaitable, Generator, Optional, Union, Type, TypeVar
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import Any, Awaitable, Generator, Optional, Union, Type, TypeVar, TypeAlias, Self
|
|
|
|
import psycopg.errors as e
|
|
|
|
@@ -32,11 +31,6 @@ if sys.version_info >= (3, 9):
|
|
else:
|
|
from typing import Counter, Deque
|
|
|
|
-if sys.version_info >= (3, 11):
|
|
- from typing import Self
|
|
-else:
|
|
- from typing_extensions import Self
|
|
-
|
|
__all__ = [
|
|
"Counter",
|
|
"Deque",
|
|
--- a/psycopg/psycopg/_pipeline.py
|
|
+++ b/psycopg/psycopg/_pipeline.py
|
|
@@ -7,7 +7,7 @@ commands pipeline management
|
|
import logging
|
|
from types import TracebackType
|
|
from typing import Any, List, Optional, Union, Tuple, Type, TYPE_CHECKING
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from . import errors as e
|
|
--- a/psycopg/psycopg/pq/abc.py
|
|
+++ b/psycopg/psycopg/pq/abc.py
|
|
@@ -6,7 +6,7 @@ Protocol objects to represent objects ex
|
|
|
|
from typing import Any, Callable, List, Optional, Sequence, Tuple
|
|
from typing import Union, TYPE_CHECKING
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from ._enums import Format, Trace
|
|
from .._compat import Protocol
|
|
--- a/psycopg/psycopg/abc.py
|
|
+++ b/psycopg/psycopg/abc.py
|
|
@@ -7,7 +7,7 @@ Protocol objects representing different
|
|
from typing import Any, Callable, Generator, Mapping
|
|
from typing import List, Optional, Sequence, Tuple, TypeVar, Union
|
|
from typing import TYPE_CHECKING
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from ._enums import PyFormat as PyFormat
|
|
--- a/psycopg/psycopg/rows.py
|
|
+++ b/psycopg/psycopg/rows.py
|
|
@@ -8,7 +8,7 @@ import functools
|
|
from typing import Any, Callable, Dict, List, Optional, NamedTuple, NoReturn
|
|
from typing import TYPE_CHECKING, Sequence, Tuple, Type, TypeVar
|
|
from collections import namedtuple
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from . import errors as e
|
|
--- a/psycopg/psycopg/_conninfo_utils.py
|
|
+++ b/psycopg/psycopg/_conninfo_utils.py
|
|
@@ -11,7 +11,7 @@ from typing import Any
|
|
from functools import lru_cache
|
|
from ipaddress import ip_address
|
|
from dataclasses import dataclass
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from . import errors as e
|
|
--- a/psycopg/psycopg/_typeinfo.py
|
|
+++ b/psycopg/psycopg/_typeinfo.py
|
|
@@ -9,7 +9,7 @@ information to the adapters if needed.
|
|
from enum import Enum
|
|
from typing import Any, Dict, Iterator, Optional, overload
|
|
from typing import Sequence, Tuple, Type, TypeVar, Union, TYPE_CHECKING
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import errors as e
|
|
from .abc import AdaptContext, Query
|
|
--- a/psycopg/psycopg/connection.py
|
|
+++ b/psycopg/psycopg/connection.py
|
|
@@ -14,7 +14,7 @@ from weakref import ref, ReferenceType
|
|
from warnings import warn
|
|
from functools import partial
|
|
from contextlib import contextmanager
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from . import errors as e
|
|
--- a/psycopg/psycopg/_queries.py
|
|
+++ b/psycopg/psycopg/_queries.py
|
|
@@ -8,7 +8,7 @@ import re
|
|
from typing import Any, Callable, Dict, List, Mapping, Match, NamedTuple, Optional
|
|
from typing import Sequence, Tuple, Union, TYPE_CHECKING
|
|
from functools import lru_cache
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from . import errors as e
|
|
--- a/psycopg/psycopg/_struct.py
|
|
+++ b/psycopg/psycopg/_struct.py
|
|
@@ -6,7 +6,7 @@ Utility functions to deal with binary st
|
|
|
|
import struct
|
|
from typing import Callable, cast, Optional, Tuple
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from .abc import Buffer
|
|
from . import errors as e
|
|
--- a/psycopg/psycopg/errors.py
|
|
+++ b/psycopg/psycopg/errors.py
|
|
@@ -21,7 +21,7 @@ DBAPI-defined Exceptions are defined in
|
|
from dataclasses import dataclass, field, fields
|
|
from typing import Any, Callable, Dict, List, NoReturn, Optional, Sequence, Tuple, Type
|
|
from typing import Union, TYPE_CHECKING
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
from asyncio import CancelledError
|
|
|
|
from .pq.abc import PGconn, PGresult
|
|
--- a/psycopg/psycopg/types/hstore.py
|
|
+++ b/psycopg/psycopg/types/hstore.py
|
|
@@ -6,7 +6,7 @@ Dict to hstore adaptation
|
|
|
|
import re
|
|
from typing import Dict, List, Optional, Type
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from .. import errors as e
|
|
from .. import postgres
|
|
--- a/psycopg/psycopg/types/enum.py
|
|
+++ b/psycopg/psycopg/types/enum.py
|
|
@@ -5,7 +5,7 @@ Adapters for the enum type.
|
|
from enum import Enum
|
|
from typing import Dict, Generic, Optional, Mapping, Sequence
|
|
from typing import Tuple, Type, TypeVar, Union, cast
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from .. import postgres
|
|
from .. import errors as e
|
|
--- a/psycopg/psycopg/types/net.py
|
|
+++ b/psycopg/psycopg/types/net.py
|
|
@@ -5,7 +5,7 @@ Adapters for network types.
|
|
# Copyright (C) 2020 The Psycopg Team
|
|
|
|
from typing import Callable, Optional, Type, Union, TYPE_CHECKING
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from .. import postgres
|
|
from ..pq import Format
|
|
--- a/psycopg/psycopg/_transform.py
|
|
+++ b/psycopg/psycopg/_transform.py
|
|
@@ -7,7 +7,7 @@ Helper object to transform values betwee
|
|
from typing import Any, Dict, List, Optional, Sequence, Tuple
|
|
from typing import DefaultDict, TYPE_CHECKING
|
|
from collections import defaultdict
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from . import postgres
|
|
--- a/psycopg/psycopg/_preparing.py
|
|
+++ b/psycopg/psycopg/_preparing.py
|
|
@@ -7,7 +7,7 @@ Support for prepared statements
|
|
from enum import IntEnum, auto
|
|
from typing import Iterator, Optional, Sequence, Tuple, TYPE_CHECKING
|
|
from collections import OrderedDict
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
from . import pq
|
|
from ._compat import Deque
|
|
--- a/tools/update_oids.py
|
|
+++ b/tools/update_oids.py
|
|
@@ -19,7 +19,7 @@ import argparse
|
|
import subprocess as sp
|
|
from typing import List
|
|
from pathlib import Path
|
|
-from typing_extensions import TypeAlias
|
|
+from typing import TypeAlias
|
|
|
|
import psycopg
|
|
from psycopg.rows import TupleRow
|