Skip to content

Commit dc0f8f2

Browse files
authored
Merge branch 'main' into docutils.readers
2 parents 17f3471 + 2e2c6fc commit dc0f8f2

File tree

9 files changed

+87
-26
lines changed

9 files changed

+87
-26
lines changed

requirements-tests.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ flake8-noqa==1.4.0 # must match .pre-commit-config.yaml
88
flake8-pyi==24.1.0 # must match .pre-commit-config.yaml
99
mypy==1.8.0
1010
pre-commit-hooks==4.5.0 # must match .pre-commit-config.yaml
11-
pytype==2024.2.13; platform_system != "Windows" and python_version < "3.12"
11+
pytype==2024.2.27; platform_system != "Windows" and python_version < "3.12"
1212
ruff==0.2.1 # must match .pre-commit-config.yaml and tests.yml
1313

1414
# Libraries used by our various scripts.

stdlib/abc.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import sys
33
from _typeshed import SupportsWrite
44
from collections.abc import Callable
55
from typing import Any, Literal, TypeVar
6-
from typing_extensions import Concatenate, ParamSpec
6+
from typing_extensions import Concatenate, ParamSpec, deprecated
77

88
_T = TypeVar("_T")
99
_R_co = TypeVar("_R_co", covariant=True)
@@ -28,15 +28,17 @@ class ABCMeta(type):
2828
def register(cls: ABCMeta, subclass: type[_T]) -> type[_T]: ...
2929

3030
def abstractmethod(funcobj: _FuncT) -> _FuncT: ...
31-
31+
@deprecated("Deprecated, use 'classmethod' with 'abstractmethod' instead")
3232
class abstractclassmethod(classmethod[_T, _P, _R_co]):
3333
__isabstractmethod__: Literal[True]
3434
def __init__(self, callable: Callable[Concatenate[type[_T], _P], _R_co]) -> None: ...
3535

36+
@deprecated("Deprecated, use 'staticmethod' with 'abstractmethod' instead")
3637
class abstractstaticmethod(staticmethod[_P, _R_co]):
3738
__isabstractmethod__: Literal[True]
3839
def __init__(self, callable: Callable[_P, _R_co]) -> None: ...
3940

41+
@deprecated("Deprecated, use 'property' with 'abstractmethod' instead")
4042
class abstractproperty(property):
4143
__isabstractmethod__: Literal[True]
4244

stdlib/sqlite3/dbapi2.pyi

Lines changed: 52 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -221,16 +221,32 @@ def adapt(__obj: Any, __proto: Any) -> Any: ...
221221
@overload
222222
def adapt(__obj: Any, __proto: Any, __alt: _T) -> Any | _T: ...
223223
def complete_statement(statement: str) -> bool: ...
224-
def connect(
225-
database: StrOrBytesPath,
226-
timeout: float = ...,
227-
detect_types: int = ...,
228-
isolation_level: str | None = ...,
229-
check_same_thread: bool = ...,
230-
factory: type[Connection] | None = ...,
231-
cached_statements: int = ...,
232-
uri: bool = ...,
233-
) -> Connection: ...
224+
225+
if sys.version_info >= (3, 12):
226+
def connect(
227+
database: StrOrBytesPath,
228+
timeout: float = ...,
229+
detect_types: int = ...,
230+
isolation_level: str | None = ...,
231+
check_same_thread: bool = ...,
232+
factory: type[Connection] | None = ...,
233+
cached_statements: int = ...,
234+
uri: bool = ...,
235+
autocommit: bool = ...,
236+
) -> Connection: ...
237+
238+
else:
239+
def connect(
240+
database: StrOrBytesPath,
241+
timeout: float = ...,
242+
detect_types: int = ...,
243+
isolation_level: str | None = ...,
244+
check_same_thread: bool = ...,
245+
factory: type[Connection] | None = ...,
246+
cached_statements: int = ...,
247+
uri: bool = ...,
248+
) -> Connection: ...
249+
234250
def enable_callback_tracebacks(__enable: bool) -> None: ...
235251

236252
if sys.version_info < (3, 12):
@@ -300,17 +316,32 @@ class Connection:
300316
def autocommit(self, val: int) -> None: ...
301317
row_factory: Any
302318
text_factory: Any
303-
def __init__(
304-
self,
305-
database: StrOrBytesPath,
306-
timeout: float = ...,
307-
detect_types: int = ...,
308-
isolation_level: str | None = ...,
309-
check_same_thread: bool = ...,
310-
factory: type[Connection] | None = ...,
311-
cached_statements: int = ...,
312-
uri: bool = ...,
313-
) -> None: ...
319+
if sys.version_info >= (3, 12):
320+
def __init__(
321+
self,
322+
database: StrOrBytesPath,
323+
timeout: float = ...,
324+
detect_types: int = ...,
325+
isolation_level: str | None = ...,
326+
check_same_thread: bool = ...,
327+
factory: type[Connection] | None = ...,
328+
cached_statements: int = ...,
329+
uri: bool = ...,
330+
autocommit: bool = ...,
331+
) -> None: ...
332+
else:
333+
def __init__(
334+
self,
335+
database: StrOrBytesPath,
336+
timeout: float = ...,
337+
detect_types: int = ...,
338+
isolation_level: str | None = ...,
339+
check_same_thread: bool = ...,
340+
factory: type[Connection] | None = ...,
341+
cached_statements: int = ...,
342+
uri: bool = ...,
343+
) -> None: ...
344+
314345
def close(self) -> None: ...
315346
if sys.version_info >= (3, 11):
316347
def blobopen(self, __table: str, __column: str, __row: int, *, readonly: bool = False, name: str = "main") -> Blob: ...

stubs/beautifulsoup4/bs4/element.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class Tag(PageElement):
234234
sourceline: int | None
235235
sourcepos: int | None
236236
known_xml: bool | None
237-
attrs: dict[str, str]
237+
attrs: dict[str, str | Any]
238238
contents: list[PageElement]
239239
hidden: bool
240240
can_be_empty_element: bool | None

stubs/html5lib/html5lib/_inputstream.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class _Encoding(Protocol):
1111

1212
_UnicodeInputStream: TypeAlias = str | SupportsRead[str]
1313
_BinaryInputStream: TypeAlias = bytes | SupportsRead[bytes]
14-
_InputStream: TypeAlias = _UnicodeInputStream # noqa: Y047 # used in other files
14+
_InputStream: TypeAlias = _UnicodeInputStream | _BinaryInputStream # noqa: Y047 # used in other files
1515

1616
spaceCharactersBytes: Any
1717
asciiLettersBytes: Any
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Internal implementation details that are intentionally missing from stub
2+
lzstring.keyStrBase64
3+
lzstring.keyStrUriSafe
4+
lzstring.baseReverseDic
5+
lzstring.Object
6+
lzstring.getBaseValue

stubs/lzstring/METADATA.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version = "1.0.*"
2+
upstream_repository = "https://github.com/gkovacs/lz-string-python"

stubs/lzstring/lzstring/__init__.pyi

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class LZString:
2+
@staticmethod
3+
def compress(uncompressed: str | None) -> str: ...
4+
@staticmethod
5+
def compressToUTF16(uncompressed: str | None) -> str: ...
6+
@staticmethod
7+
def compressToBase64(uncompressed: str | None) -> str: ...
8+
@staticmethod
9+
def compressToEncodedURIComponent(uncompressed: str | None) -> str: ...
10+
@staticmethod
11+
def decompress(compressed: str | None) -> str | None: ...
12+
@staticmethod
13+
def decompressFromUTF16(compressed: str | None) -> str | None: ...
14+
@staticmethod
15+
def decompressFromBase64(compressed: str | None) -> str | None: ...
16+
@staticmethod
17+
def decompressFromEncodedURIComponent(compressed: str | None) -> str | None: ...

stubs/pyOpenSSL/OpenSSL/SSL.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ TLSv1_2_METHOD: int
2424
TLS_METHOD: int
2525
TLS_SERVER_METHOD: int
2626
TLS_CLIENT_METHOD: int
27+
DTLS_METHOD: int
28+
DTLS_SERVER_METHOD: int
29+
DTLS_CLIENT_METHOD: int
2730

2831
SSL3_VERSION: int
2932
TLS1_VERSION: int

0 commit comments

Comments
 (0)