Skip to content

Commit f808b7e

Browse files
authored
Merge branch 'main' into rm-pytype
2 parents 5b29788 + f15658b commit f808b7e

4 files changed

Lines changed: 21 additions & 4 deletions

File tree

.github/workflows/daily.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ jobs:
117117
# Keep in sync with stub_uploader's check_scripts.yml workflow.
118118
python-version: "3.13"
119119
- uses: astral-sh/setup-uv@v6
120+
with:
121+
version-file: "typeshed/requirements-tests.txt"
120122
- name: Run tests
121123
run: |
122124
cd stub_uploader

.github/workflows/tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ jobs:
9999
with:
100100
python-version: "3.13"
101101
- uses: astral-sh/setup-uv@v6
102+
with:
103+
version-file: "requirements-tests.txt"
102104
- name: Install typeshed test-suite requirements
103105
# Install these so we can run `get_external_stub_requirements.py`
104106
run: uv pip install -r requirements-tests.txt --system
@@ -165,6 +167,8 @@ jobs:
165167
# Keep in sync with stub_uploader's check_scripts.yml workflow.
166168
python-version: "3.13"
167169
- uses: astral-sh/setup-uv@v6
170+
with:
171+
version-file: "typeshed/requirements-tests.txt"
168172
- name: Run tests
169173
run: |
170174
cd stub_uploader

stdlib/difflib.pyi

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import re
2+
import sys
13
from collections.abc import Callable, Iterable, Iterator, Sequence
24
from types import GenericAlias
35
from typing import Any, AnyStr, Generic, Literal, NamedTuple, TypeVar, overload
@@ -60,7 +62,12 @@ class Differ:
6062
def __init__(self, linejunk: Callable[[str], bool] | None = None, charjunk: Callable[[str], bool] | None = None) -> None: ...
6163
def compare(self, a: Sequence[str], b: Sequence[str]) -> Iterator[str]: ...
6264

63-
def IS_LINE_JUNK(line: str, pat: Any = ...) -> bool: ... # pat is undocumented
65+
if sys.version_info >= (3, 14):
66+
def IS_LINE_JUNK(line: str, pat: Callable[[str], re.Match[str] | None] | None = None) -> bool: ...
67+
68+
else:
69+
def IS_LINE_JUNK(line: str, pat: Callable[[str], re.Match[str] | None] = ...) -> bool: ...
70+
6471
def IS_CHARACTER_JUNK(ch: str, ws: str = " \t") -> bool: ... # ws is undocumented
6572
def unified_diff(
6673
a: Sequence[str],

stdlib/ssl.pyi

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ class SSLCertVerificationError(SSLError, ValueError):
8080
CertificateError = SSLCertVerificationError
8181

8282
if sys.version_info < (3, 12):
83+
@deprecated("Deprecated since Python 3.7. Removed in Python 3.12. Use `SSLContext.wrap_socket()` instead.")
8384
def wrap_socket(
8485
sock: socket.socket,
8586
keyfile: StrOrBytesPath | None = None,
@@ -132,6 +133,7 @@ else:
132133
_create_default_https_context: Callable[..., SSLContext]
133134

134135
if sys.version_info < (3, 12):
136+
@deprecated("Deprecated since Python 3.7. Removed in Python 3.12.")
135137
def match_hostname(cert: _PeerCertRetDictType, hostname: str) -> None: ...
136138

137139
def cert_time_to_seconds(cert_time: str) -> int: ...
@@ -416,9 +418,11 @@ class SSLContext(_SSLContext):
416418
if sys.version_info >= (3, 10):
417419
security_level: int
418420
if sys.version_info >= (3, 10):
419-
# Using the default (None) for the `protocol` parameter is deprecated,
420-
# but there isn't a good way of marking that in the stub unless/until PEP 702 is accepted
421-
def __new__(cls, protocol: int | None = None, *args: Any, **kwargs: Any) -> Self: ...
421+
@overload
422+
def __new__(cls, protocol: int, *args: Any, **kwargs: Any) -> Self: ...
423+
@overload
424+
@deprecated("Deprecated since Python 3.10. Use a specific version of the SSL protocol.")
425+
def __new__(cls, protocol: None = None, *args: Any, **kwargs: Any) -> Self: ...
422426
else:
423427
def __new__(cls, protocol: int = ..., *args: Any, **kwargs: Any) -> Self: ...
424428

0 commit comments

Comments
 (0)