Skip to content

Sync vendored typeshed stubs#18110

Merged
carljm merged 3 commits intomainfrom
typeshedbot/sync-typeshed
May 15, 2025
Merged

Sync vendored typeshed stubs#18110
carljm merged 3 commits intomainfrom
typeshedbot/sync-typeshed

Conversation

@github-actions
Copy link
Contributor

Close and reopen this PR to trigger CI

@github-actions github-actions bot added the internal An internal refactor or improvement label May 15, 2025
@github-actions github-actions bot added the internal An internal refactor or improvement label May 15, 2025
@AlexWaygood AlexWaygood reopened this May 15, 2025
@github-actions
Copy link
Contributor Author

github-actions bot commented May 15, 2025

mypy_primer results

Changes were detected when running on open source projects
trio (https://github.com/python-trio/trio)
- error[type-assertion-failure] src/trio/_tests/type_tests/path.py:127:5: Argument does not have asserted type `AsyncIOWrapper[BufferedReader]`
+ error[type-assertion-failure] src/trio/_tests/type_tests/path.py:127:5: Argument does not have asserted type `AsyncIOWrapper[BufferedReader[_BufferedReaderStream]]`

urllib3 (https://github.com/urllib3/urllib3)
+ warning[unused-ignore-comment] test/test_response.py:770:36: Unused blanket `type: ignore` directive
+ warning[unused-ignore-comment] test/test_response.py:782:41: Unused blanket `type: ignore` directive
+ warning[unused-ignore-comment] test/test_response.py:787:39: Unused blanket `type: ignore` directive
+ warning[unused-ignore-comment] test/test_response.py:800:40: Unused blanket `type: ignore` directive
- Found 464 diagnostics
+ Found 468 diagnostics

mypy (https://github.com/python/mypy)
- error[invalid-argument-type] mypy/fastparse.py:1376:36: Argument to bound method `__init__` is incorrect: Expected `str`, found `@Todo(Support for `typing.TypeAlias`) | None`
+ error[invalid-argument-type] mypy/fastparse.py:1376:36: Argument to bound method `__init__` is incorrect: Expected `str`, found `str | None`
+ error[unresolved-import] mypy/typeshed/stdlib/email/__init__.pyi:3:34: Module `email.policy` has no member `_MessageT`
+ error[unresolved-import] mypy/typeshed/stdlib/email/mime/message.pyi:2:34: Module `email.policy` has no member `_MessageT`
+ error[unresolved-import] mypy/typeshed/stdlib/email/mime/multipart.pyi:4:34: Module `email.policy` has no member `_MessageT`
- Found 3358 diagnostics
+ Found 3361 diagnostics

pytest (https://github.com/pytest-dev/pytest)
- error[unsupported-operator] src/_pytest/assertion/rewrite.py:1097:34: Operator `+` is unsupported between objects of type `@Todo(Support for `typing.TypeAlias`) | None` and `Literal["="]`
+ error[unsupported-operator] src/_pytest/assertion/rewrite.py:1097:34: Operator `+` is unsupported between objects of type `str | None` and `Literal["="]`

dd-trace-py (https://github.com/DataDog/dd-trace-py)
- error[unresolved-attribute] tests/appsec/appsec/test_common_modules.py:36:16: Type `Overload[(file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`) = Literal["r"], buffering: int = Literal[-1], encoding: str | None = None, errors: str | None = None, newline: str | None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> TextIOWrapper[_WrappedBuffer], (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> FileIO, (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[-1, 1] = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BufferedRandom, (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[-1, 1] = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BufferedWriter, (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[-1, 1] = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BufferedReader, (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: int = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BinaryIO, (file: @Todo(Support for `typing.TypeAlias`), mode: str, buffering: int = Literal[-1], encoding: str | None = None, errors: str | None = None, newline: str | None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> IO[Any]]` has no attribute `__wrapped__`
+ error[unresolved-attribute] tests/appsec/appsec/test_common_modules.py:36:16: Type `Overload[(file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`) = Literal["r"], buffering: int = Literal[-1], encoding: str | None = None, errors: str | None = None, newline: str | None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> TextIOWrapper[_WrappedBuffer], (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[0], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> FileIO, (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[-1, 1] = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BufferedRandom, (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[-1, 1] = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BufferedWriter, (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: Literal[-1, 1] = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BufferedReader[_BufferedReaderStream], (file: @Todo(Support for `typing.TypeAlias`), mode: @Todo(Support for `typing.TypeAlias`), buffering: int = Literal[-1], encoding: None = None, errors: None = None, newline: None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> BinaryIO, (file: @Todo(Support for `typing.TypeAlias`), mode: str, buffering: int = Literal[-1], encoding: str | None = None, errors: str | None = None, newline: str | None = None, closefd: bool = Literal[True], opener: @Todo(Inference of subscript on special form) | None = None) -> IO[Any]]` has no attribute `__wrapped__`

@carljm
Copy link
Contributor

carljm commented May 15, 2025

I'm fixing this up. Mostly just insta snapshots from changed typeshed line numbers, but there is one odd failure related to the __value__ attribute of a PEP 695 type alias.

@AlexWaygood
Copy link
Member

A bit of a perf regression due to the new 3.14 branches, but such is life: https://codspeed.io/astral-sh/ruff/branches/typeshedbot%2Fsync-typeshed

@carljm
Copy link
Contributor

carljm commented May 15, 2025

The return value of TypeAliasType.__value__ in typeshed is now AnnotationForm, which is a TypeAlias for Any, thus the new @Todo type in the PEP695 type alias tests.

@carljm carljm merged commit b600ff1 into main May 15, 2025
34 checks passed
@carljm carljm deleted the typeshedbot/sync-typeshed branch May 15, 2025 02:14
Glyphack pushed a commit to Glyphack/ruff that referenced this pull request May 21, 2025
Close and reopen this PR to trigger CI

---------

Co-authored-by: typeshedbot <>
Co-authored-by: Carl Meyer <carl@astral.sh>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal An internal refactor or improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants