Remove Python 3.7 branches (#11238)

This commit is contained in:
Sebastian Rittau
2024-01-05 11:39:39 +01:00
committed by GitHub
parent 4e62577002
commit 23604858a6
122 changed files with 1952 additions and 3800 deletions

View File

@@ -1,14 +1,9 @@
import sys
from collections.abc import Iterator, Sequence
from configparser import ConfigParser
from re import Pattern
from typing import Any
from typing_extensions import Self
if sys.version_info >= (3, 8):
from re import Pattern
else:
from re import Pattern
entry_point_pattern: Pattern[str]
file_in_zip_pattern: Pattern[str]

View File

@@ -26,6 +26,5 @@ if sys.platform != "win32":
forkpty: Callable[[], tuple[int, int]] = ...,
) -> tuple[int, int]: ...
if sys.version_info >= (3, 8):
posix_spawn = os.posix_spawn
posix_spawnp = os.posix_spawnp
posix_spawn = os.posix_spawn
posix_spawnp = os.posix_spawnp

View File

@@ -1,11 +1,2 @@
import sys
if sys.version_info >= (3, 8):
from asyncio import iscoroutinefunction as iscoroutinefunction
from unittest import IsolatedAsyncioTestCase as IsolatedAsyncioTestCase
else:
import unittest
class IsolatedAsyncioTestCase(unittest.TestCase): ...
# It is a typeguard, but its signature is to complex to duplicate.
def iscoroutinefunction(obj: object) -> bool: ...
from asyncio import iscoroutinefunction as iscoroutinefunction
from unittest import IsolatedAsyncioTestCase as IsolatedAsyncioTestCase

View File

@@ -3,12 +3,8 @@ from typing_extensions import Final, TypeAlias
# NOTE: Can't specify numpy as a dependency because openpyxl doesn't declare it as one
# import numpy
# if sys.version_info >= (3, 8):
# import numpy._typing
# _NBitBase: TypeAlias = numpy._typing.NBitBase
# else:
# _NBitBase: TypeAlias = Any
# import numpy._typing
# _NBitBase: TypeAlias = numpy._typing.NBitBase
# _NumericTypes: TypeAlias = int | float | Decimal | numpy.bool_ | numpy.floating[_NBitBase] | numpy.integer[_NBitBase]
_NumericTypes: TypeAlias = int | float | Decimal

View File

@@ -1,6 +1,5 @@
# This file does not exist at runtime. It is a helper file to overload imported functions in openpyxl.xml.functions
import sys
from _typeshed import Incomplete, ReadableBuffer
from collections.abc import Iterable, Iterator, Mapping, Sequence
from typing import Any, Protocol, TypeVar, overload
@@ -86,20 +85,15 @@ def fromstring(text: str, forbid_dtd: bool = False, forbid_entities: bool = True
# from xml.etree.ElementTree import tostring
# But made partial, removing encoding arg
if sys.version_info >= (3, 8):
@overload
def tostring(
element: Element,
method: str | None = "xml",
*,
xml_declaration: bool | None = None,
default_namespace: str | None = ...,
short_empty_elements: bool = ...,
) -> str: ...
else:
@overload
def tostring(element: Element, method: str | None = ..., *, short_empty_elements: bool = ...) -> str: ...
@overload
def tostring(
element: Element,
method: str | None = "xml",
*,
xml_declaration: bool | None = None,
default_namespace: str | None = ...,
short_empty_elements: bool = ...,
) -> str: ...
# from lxml.etree import Element
# But made partial, removing encoding arg

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import Incomplete
from collections.abc import Callable, Iterable, Mapping, Sequence
from importlib.metadata import Distribution
from typing import Any
from typing_extensions import TypeAlias
@@ -18,11 +18,6 @@ from ._hooks import (
from ._result import _Result as _Result
from ._tracing import TagTracerSub
if sys.version_info >= (3, 8):
from importlib.metadata import Distribution
else:
Distribution: TypeAlias = Any
_BeforeTrace: TypeAlias = Callable[[str, Sequence[HookImpl], Mapping[str, Any]], None]
_AfterTrace: TypeAlias = Callable[[_Result[Any], str, Sequence[HookImpl], Mapping[str, Any]], None]

View File

@@ -1,3 +1,3 @@
psycopg2.pool.AbstractConnectionPool.(closeall|getconn|putconn)
psycopg2.(extras|_range).RangeAdapter.name
psycopg2.(_psycopg|extensions).connection.async # async is a reserved keyword in Python 3.7
psycopg2.(_psycopg|extensions).connection.async # async is a reserved keyword

View File

@@ -142,11 +142,6 @@ class AnnotationState:
def in_annotation(func: _F) -> _F: ...
def in_string_annotation(func: _F) -> _F: ...
if sys.version_info >= (3, 8):
_NamedExpr: TypeAlias = ast.NamedExpr
else:
_NamedExpr: TypeAlias = Any
if sys.version_info >= (3, 10):
_Match: TypeAlias = ast.Match
_MatchCase: TypeAlias = ast.match_case
@@ -247,7 +242,7 @@ class Checker:
def ATTRIBUTE(self, tree: ast.Attribute, omit: _OmitType = None) -> None: ...
def STARRED(self, tree: ast.Starred, omit: _OmitType = None) -> None: ...
def NAMECONSTANT(self, tree: ast.NameConstant, omit: _OmitType = None) -> None: ...
def NAMEDEXPR(self, tree: _NamedExpr, omit: _OmitType = None) -> None: ...
def NAMEDEXPR(self, tree: ast.NamedExpr, omit: _OmitType = None) -> None: ...
def SUBSCRIPT(self, node: ast.Subscript) -> None: ...
def CALL(self, node: ast.Call) -> None: ...
def BINOP(self, node: ast.BinOp) -> None: ...

View File

@@ -1,20 +1,11 @@
# https://pyinstaller.org/en/stable/hooks.html#module-PyInstaller.utils.hooks.conda
import sys
from _typeshed import StrOrBytesPath
from collections.abc import Iterable
from pathlib import Path, PurePosixPath
from importlib.metadata import PackagePath as _PackagePath
from pathlib import Path
from typing_extensions import Final, TypedDict
if sys.version_info >= (3, 8):
from importlib.metadata import PackagePath as _PackagePath
else:
# Same as importlib_metadata.PackagePath
class _PackagePath(PurePosixPath):
def read_text(self, encoding: str = "utf-8") -> str: ...
def read_binary(self) -> str: ...
def locate(self) -> Path: ...
CONDA_ROOT: Final[Path]
CONDA_META_DIR: Final[Path]
PYTHONPATH_PREFIXES: Final[list[Path]]