PY-87327 Update typeshed version to c01356380fd56b42aa49a0aac8a320437fc7f7b9

Closes PY-87327

GitOrigin-RevId: 534518d6a55743f893955f91803db209dee81ab2
This commit is contained in:
PyCharm Automation Bot
2026-02-04 13:15:58 +00:00
committed by intellij-monorepo-bot
parent 49932df39b
commit 3a544b6c29
24 changed files with 168 additions and 46 deletions
+26 -6
View File
@@ -28,6 +28,24 @@ except ImportError:
return text
_REMOVE_COMMENT_RE = re.compile(
r"""
(\"(?:\\.|[^\\\"])*?\") # matches literal strings
|
(\/\*.*?\*\/ | \/\/[^\r\n]*?(?:[\r\n])) # matches single- and multi-line comments
""",
re.DOTALL | re.VERBOSE,
)
_REMOVE_TRAILING_COMMA_RE = re.compile(
r"""
(\"(?:\\.|[^\\\"])*?\") # matches literal strings
|
,\s*([\]}]) # matches commas before '}' or ']'
""",
re.DOTALL | re.VERBOSE,
)
PYTHON_VERSION: Final = f"{sys.version_info.major}.{sys.version_info.minor}"
@@ -35,13 +53,15 @@ def strip_comments(text: str) -> str:
return text.split("#")[0].strip()
def json5_to_json(text: str) -> str:
"""Incomplete conversion from JSON5-like input to valid JSON."""
# Remove full-line // comments only
# (Can not remove inline comments)
text = re.sub(r"(?m)^\s*//.*\n?", "", text)
def jsonc_to_json(text: str) -> str:
"""Conversion from JSONC format input to valid JSON."""
# Remove comments
if not text.endswith("\n"):
text += "\n"
text = _REMOVE_COMMENT_RE.sub(lambda m: m.group(1) or "", text)
# Remove trailing commas before } or ]
text = re.sub(r",\s*([}\]])", r"\1", text)
text = _REMOVE_TRAILING_COMMA_RE.sub(lambda m: m.group(1) or m.group(2), text)
return text
@@ -105,12 +105,18 @@ async def get_upstream_repo_url(project: str) -> str | None:
# Remove `www.`; replace `http://` with `https://`
url = re.sub(r"^(https?://)?(www\.)?", "https://", url_to_check)
netloc = urllib.parse.urlparse(url).netloc
if netloc in {"gitlab.com", "github.com", "bitbucket.org", "foss.heptapod.net"}:
# truncate to https://site.com/user/repo
upstream_repo_url = "/".join(url.split("/")[:5])
async with session.get(upstream_repo_url) as response:
if response.status == HTTPStatus.OK:
return upstream_repo_url
if netloc not in {"gitlab.com", "github.com", "bitbucket.org", "foss.heptapod.net"}:
continue
# truncate to https://site.com/user/repo
upstream_repo_url = "/".join(url.split("/")[:5])
async with session.get(upstream_repo_url, allow_redirects=True) as response:
if response.status != HTTPStatus.OK:
continue
# final url after redirects
final_url = str(response.url)
# normalize again (in case redirect added extra path)
final_repo_url = "/".join(final_url.split("/")[:5])
return final_repo_url
return None
@@ -63,6 +63,10 @@ class _lru_cache_wrapper(Generic[_T_co]):
def __copy__(self) -> _lru_cache_wrapper[_T_co]: ...
def __deepcopy__(self, memo: Any, /) -> _lru_cache_wrapper[_T_co]: ...
# as with ``Callable``, we'll assume that these attributes exist
__name__: str
__qualname__: str
@overload
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
@overload
@@ -1,3 +1,3 @@
version = "1.6.6"
upstream_repository = "https://github.com/lepture/authlib"
upstream_repository = "https://github.com/authlib/authlib"
requires = ["cryptography"]
@@ -1,3 +1,3 @@
version = "~=1.3.1"
upstream_repository = "https://github.com/tantale/deprecated"
upstream_repository = "https://github.com/laurent-laporte-pro/deprecated"
requires = []
@@ -69,5 +69,5 @@ def assert_that(val: _V, description: str = "") -> AssertionBuilder[_V]: ...
def assert_warn(val: _V, description: str = "", logger: logging.Logger | None = None) -> AssertionBuilder: ...
def fail(msg: str = "") -> None: ...
def soft_fail(msg: str = "") -> None: ...
def add_extension(func: Callable[[AssertionBuilder], AssertionBuilder]) -> None: ...
def remove_extension(func: Callable[[AssertionBuilder], AssertionBuilder]) -> None: ...
def add_extension(func: Callable[..., AssertionBuilder[Any]]) -> None: ...
def remove_extension(func: Callable[..., AssertionBuilder[Any]]) -> None: ...
@@ -1,5 +1,5 @@
version = "2.8.4"
upstream_repository = "https://github.com/PyFPDF/fpdf2"
upstream_repository = "https://github.com/py-pdf/fpdf2"
requires = ["Pillow>=10.3.0"]
[tool.stubtest]
@@ -3,3 +3,7 @@ gunicorn._types
# .pyi file doesn't exist
gunicorn.__main__
# Internal API stuff:
gunicorn.config.Config.forwarded_allow_networks
gunicorn.config.Config.proxy_allow_networks
@@ -1,4 +1,4 @@
version = "24.1.0"
version = "24.1.*"
upstream_repository = "https://github.com/benoitc/gunicorn"
requires = ["types-gevent"]
@@ -6,7 +6,6 @@ from typing_extensions import Self, TypeAlias, deprecated
from ._types import TypeChecker
from ._utils import Unset
from .protocols import Validator
_RelevanceFuncType: TypeAlias = Callable[[ValidationError], SupportsRichComparison]
@@ -21,7 +20,7 @@ class _Error(Exception):
relative_schema_path: deque[str | int]
context: list[ValidationError]
cause: Exception | None
validator: Validator | Unset
validator: str | Unset
validator_value: Any | Unset
instance: Any | Unset
schema: Mapping[str, Any] | bool | Unset
@@ -1,2 +1,2 @@
version = "1.3.*"
upstream_repository = "https://github.com/drkjam/netaddr"
upstream_repository = "https://github.com/netaddr/netaddr"
@@ -1,4 +1,4 @@
version = "7.2.1"
version = "7.2.2"
upstream_repository = "https://github.com/giampaolo/psutil"
[tool.stubtest]
@@ -58,16 +58,21 @@ class Negsignal(enum.IntEnum):
SIGSTKFLT = -16
def negsig_to_enum(num: int) -> int: ...
def wait_pid(
def convert_exit_code(status: int) -> int: ...
def wait_pid_posix(
pid: int,
timeout: float | None = None,
proc_name: str | None = None,
_waitpid: Unused = ...,
_timer: Callable[[], float] = ...,
_min: Callable[..., Incomplete] = ...,
_sleep: Callable[[float], None] = ...,
_pid_exists: Callable[[int], bool] = ...,
) -> int | None: ...
def wait_pid_pidfd_open(pid: int, timeout: float | None = None) -> int | None: ...
def wait_pid_kqueue(pid: int, timeout: float | None = None) -> int | None: ...
def can_use_pidfd_open() -> bool: ...
def can_use_kqueue() -> bool: ...
def wait_pid(pid: int, timeout: float | None = None) -> int | None: ...
if sys.platform == "darwin":
def disk_usage(path: StrOrBytesPath) -> ntp.sdiskusage: ...
@@ -1,4 +1,4 @@
version = "4.67.*"
version = "4.67.2"
upstream_repository = "https://github.com/tqdm/tqdm"
requires = ["types-requests"]
@@ -23,7 +23,7 @@ class TqdmTypeError(TypeError): ...
class TqdmKeyError(KeyError): ...
class TqdmWarning(Warning):
def __init__(self, msg, fp_write=None, *a, **k) -> None: ...
def __init__(self, msg, fp_write=None) -> None: ...
class TqdmExperimentalWarning(TqdmWarning, FutureWarning): ...
class TqdmDeprecationWarning(TqdmWarning, DeprecationWarning): ...
@@ -1,2 +1,2 @@
version = "3.3.*"
upstream_repository = "https://github.com/RedFantom/ttkthemes"
upstream_repository = "https://github.com/TkinterEP/ttkthemes"
@@ -1,2 +1,2 @@
version = "0.9.*"
upstream_repository = "https://github.com/alexsdutton/www-authenticate"
upstream_repository = "https://github.com/alexdutton/www-authenticate"
@@ -1,3 +1,3 @@
version = "2025.12.08"
version = "2026.01.31"
upstream_repository = "https://github.com/yt-dlp/yt-dlp"
requires = ["websockets"]
@@ -89,7 +89,7 @@ class YoutubeDL:
def dl(self, name: str, info: _InfoDict, subtitle: bool = False, test: bool = False) -> bool: ...
def existing_file(self, filepaths: Iterable[str], *, default_overwrite: bool = True) -> str | None: ...
def process_info(self, info_dict: _InfoDict) -> None: ...
def download(self, url_list: Collection[str]) -> None: ...
def download(self, url_list: Collection[str]) -> int: ...
def download_with_info_file(self, info_filename: str) -> int: ...
@staticmethod
def sanitize_info(info_dict: _InfoDict, remove_private_keys: bool = False) -> _InfoDict | None: ...
@@ -0,0 +1,3 @@
from .common import FileDownloader
class SoopVodFD(FileDownloader): ...
@@ -1,5 +1,5 @@
import re
from _typeshed import Unused
from _typeshed import Incomplete, Unused
from collections.abc import Callable, Collection, Iterable, Iterator, Mapping, Sequence
from functools import cached_property
from json.decoder import JSONDecoder
@@ -8,6 +8,8 @@ from typing_extensions import Never, Required, TypeAlias, deprecated
from urllib.request import Request, _DataType
from xml.etree import ElementTree as ET
from yt_dlp.utils import PagedList
from ..cache import Cache
from ..cookies import LenientSimpleCookie, YoutubeDLCookieJar
from ..networking.common import Response, _RequestData
@@ -17,22 +19,101 @@ from ..YoutubeDL import YoutubeDL
@type_check_only
class _InfoDict(TypedDict, total=False):
age_limit: int
availability: Literal["private", "premium_only", "subscriber_only", "needs_auth", "unlisted", "public"] | None
available_at: int
creator: str | None
comment_count: int | None
duration: int | None
formats: list[dict[str, Any]] | None
id: Required[str]
like_count: int | None
tags: list[str] | None
thumbnail: str | None
timestamp: int | float | None
title: str | None
uploader: str | None
formats: list[dict[str, Any]] | None
available_at: int
url: str | None
ext: str | None
format: str | None
player_url: str | None
direct: bool | None
alt_title: str | None
display_id: Incomplete
thumbnails: list[dict[str, Incomplete]] | None
thumbnail: str | None
description: str | None
uploader: str | None
license: str | None
creators: list[str] | None
timestamp: int | float | None
upload_date: Incomplete
release_timestamp: Incomplete
release_date: Incomplete
release_year: Incomplete
modified_timestamp: Incomplete
modified_date: Incomplete
uploader_id: Incomplete
uploader_url: str | None
channel: str | None
channel_id: Incomplete
channel_url: str | None
channel_follower_count: int | None
channel_is_verified: Incomplete
location: Incomplete
subtitles: Incomplete
automatic_captions: Incomplete
duration: int | None
view_count: int | None
concurrent_view_count: int | None
save_count: int | None
like_count: int | None
dislike_count: int | None
repost_count: int | None
average_rating: Incomplete
comment_count: int | None
comments: Incomplete
age_limit: int
webpage_url: str | None
categories: list[str] | None
tags: list[str] | None
cast: list[Incomplete] | None
is_live: bool | None
was_live: bool | None
live_status: Literal["is_live", "is_upcoming", "was_live", "not_live", "post_live"] | None
start_time: Incomplete
end_time: Incomplete
chapters: Incomplete
heatmap: Incomplete
playable_in_embed: bool | str | None
availability: Literal["private", "premium_only", "subscriber_only", "needs_auth", "unlisted", "public"] | None
media_type: str | None
_old_archive_ids: Incomplete
_format_sort_fields: Incomplete
chapter: str | None
chapter_number: int | None
chapter_id: str | None
series: str | None
series_id: str | None
season: str | None
season_number: int | None
season_id: str | None
episode: Incomplete
episode_number: int | None
episode_id: str | None
track: str | None
track_number: int | None
track_id: str | None
artists: list[str] | None
composers: list[str] | None
genres: list[str] | None
album: str | None
album_type: str | None
album_artists: list[str] | None
disc_number: int | None
section_start: Incomplete
section_end: Incomplete
rows: int | None
columns: int | None
playlist_count: int | None
entries: Iterable[_InfoDict] | PagedList
requested_formats: Iterable[_InfoDict]
# deprecated fields:
composer: Incomplete
artist: Incomplete
genre: Incomplete
album_artist: Incomplete
creator: str | None
_StrNoDefaultOrNone: TypeAlias = str | None | type[NO_DEFAULT]
_T = TypeVar("_T")
@@ -274,7 +274,7 @@ def extract_timezone(date_str: str, default: Any = None) -> tuple[timedelta, str
def parse_iso8601(date_str: str, delimiter: str = "T", timezone: type[NO_DEFAULT] | Any | None = None) -> int: ...
def date_formats(day_first: bool = True) -> list[str]: ...
def unified_strdate(date_str: str, day_first: bool = True) -> str: ...
def unified_timestamp(date_str: str, day_first: bool = True) -> int: ...
def unified_timestamp(date_str: str, day_first: bool = True, tz_offset: float = 0) -> int: ...
def determine_ext(url: str, default_ext: str = "unknown_video") -> str: ...
def subtitles_filename(filename: str, sub_lang: str, sub_format: str, expected_real_ext: str | None = None) -> str: ...
def datetime_from_str(date_str: str, precision: str = "auto", format: str = "%Y%m%d") -> datetime: ...
@@ -17,7 +17,7 @@ from ts_utils.paths import PYRIGHT_CONFIG, REQUIREMENTS_PATH, STDLIB_PATH, STUBS
from ts_utils.utils import (
get_all_testcase_directories,
get_gitignore_spec,
json5_to_json,
jsonc_to_json,
parse_requirements,
parse_stdlib_versions_file,
spec_matches_path,
@@ -178,7 +178,7 @@ def check_requirement_pins() -> None:
def check_pyright_exclude_order() -> None:
"""Check that 'exclude' entries in pyrightconfig.stricter.json are sorted alphabetically."""
text = PYRIGHT_CONFIG.read_text(encoding="utf-8")
text = json5_to_json(text)
text = jsonc_to_json(text)
data = json.loads(text)
exclude: list[str] = data.get("exclude", [])