Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync typeshed #15444

Merged
merged 5 commits into from
Jun 15, 2023
Merged

Sync typeshed #15444

merged 5 commits into from
Jun 15, 2023

Conversation

AlexWaygood
Copy link
Member

Source commit: python/typeshed@c38fc45

Changes in builtins and functools caused the automated PR failed last night due to merge conflicts in the cherry-picks: https://github.com/python/mypy/actions/runs/5273276786

⚠️ Remember to use "rebase and merge" rather than "squash and merge" for this PR, so that we can easily update the commit hashes to cherry-pick in the misc/sync-typeshed.py script.

AlexWaygood and others added 5 commits June 15, 2023 15:58
This is allegedly causing large performance problems, see 13821

typeshed/8231 had zero hits on mypy_primer, so it's not the worst thing
to undo. Patching this in typeshed also feels weird, since there's a
more general soundness issue. If a typevar has a bound or constraint, we
might not want to solve it to a Literal.

If we can confirm the performance regression or fix the unsoundness
within mypy, I might pursue upstreaming this in typeshed.

(Reminder: add this to the sync_typeshed script once merged)
Since the plugin provides superior type checking: python#13987 (comment)
A manual cherry-pick of e437cdf.
@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

koda-validate (https://github.com/keithasaurus/koda-validate)
+ koda_validate/namedtuple.py:207: error: No overload variant of "NamedTuple" matches argument type "dict[Any, Any]"  [call-overload]
+ koda_validate/namedtuple.py:207: note: Possible overload variants:
+ koda_validate/namedtuple.py:207: note:     def __init__(self, str, Iterable[tuple[str, Any]], /) -> _NTT
+ koda_validate/namedtuple.py:207: note:     def __init__(self, str, None = ..., /, **kwargs: Any) -> _NTT
+ koda_validate/namedtuple.py:258: error: No overload variant of "NamedTuple" matches argument type "dict[Any, Any]"  [call-overload]
+ koda_validate/namedtuple.py:258: note: Possible overload variants:
+ koda_validate/namedtuple.py:258: note:     def __init__(self, str, Iterable[tuple[str, Any]], /) -> _NTT
+ koda_validate/namedtuple.py:258: note:     def __init__(self, str, None = ..., /, **kwargs: Any) -> _NTT

anyio (https://github.com/agronholm/anyio)
+ src/anyio/_core/_fileio.py:382: error: Unused "type: ignore" comment  [unused-ignore]

pydantic (https://github.com/samuelcolvin/pydantic)
+ pydantic/v1/validators.py:614: error: No overload variant of "NamedTuple" matches argument type "dict[str, Any]"  [call-overload]
+ pydantic/v1/validators.py:614: note: Possible overload variants:
+ pydantic/v1/validators.py:614: note:     def __init__(self, str, Iterable[tuple[str, Any]], /) -> NamedTupleT
+ pydantic/v1/validators.py:614: note:     def __init__(self, str, None = ..., /, **kwargs: Any) -> NamedTupleT

ibis (https://github.com/ibis-project/ibis)
+ ibis/common/egraph.py:111: error: Argument 1 of "__eq__" is incompatible with supertype "Mapping"; supertype defines the argument type as "object"  [override]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/connections/base_connection_test.py: note: In member "test_secrets_property_no_matching_section" of class "ExperimentalBaseConnectionDefaultMethodTests":
- lib/tests/streamlit/connections/base_connection_test.py:58:16: error: Non-overlapping equality check (left operand type: "AttrDict", right operand type: "Dict[<nothing>, <nothing>]")  [comparison-overlap]
- lib/tests/streamlit/connections/base_connection_test.py: note: In member "test_secrets_property_no_secrets" of class "ExperimentalBaseConnectionDefaultMethodTests":
- lib/tests/streamlit/connections/base_connection_test.py:62:16: error: Non-overlapping equality check (left operand type: "AttrDict", right operand type: "Dict[<nothing>, <nothing>]")  [comparison-overlap]

materialize (https://github.com/MaterializeInc/materialize)
+ misc/python/materialize/mzcompose/__init__.py:904: error: Signature of "parse_known_args" incompatible with supertype "ArgumentParser"  [override]
+ misc/python/materialize/mzcompose/__init__.py:904: note:      Superclass:
+ misc/python/materialize/mzcompose/__init__.py:904: note:          @overload
+ misc/python/materialize/mzcompose/__init__.py:904: note:          def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/mzcompose/__init__.py:904: note:          @overload
+ misc/python/materialize/mzcompose/__init__.py:904: note:          def [_N] parse_known_args(self, args: Optional[Sequence[str]], namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/mzcompose/__init__.py:904: note:          @overload
+ misc/python/materialize/mzcompose/__init__.py:904: note:          def [_N] parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/mzcompose/__init__.py:904: note:      Subclass:
+ misc/python/materialize/mzcompose/__init__.py:904: note:          def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: error: Signature of "parse_known_args" incompatible with supertype "ArgumentParser"  [override]
+ misc/python/materialize/cli/mzcompose.py:670: note:      Superclass:
+ misc/python/materialize/cli/mzcompose.py:670: note:          @overload
+ misc/python/materialize/cli/mzcompose.py:670: note:          def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: note:          @overload
+ misc/python/materialize/cli/mzcompose.py:670: note:          def [_N] parse_known_args(self, args: Optional[Sequence[str]], namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: note:          @overload
+ misc/python/materialize/cli/mzcompose.py:670: note:          def [_N] parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:670: note:      Subclass:
+ misc/python/materialize/cli/mzcompose.py:670: note:          def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: error: Signature of "parse_known_args" incompatible with supertype "ArgumentParser"  [override]
+ misc/python/materialize/cli/mzcompose.py:681: note:      Superclass:
+ misc/python/materialize/cli/mzcompose.py:681: note:          @overload
+ misc/python/materialize/cli/mzcompose.py:681: note:          def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: note:          @overload
+ misc/python/materialize/cli/mzcompose.py:681: note:          def [_N] parse_known_args(self, args: Optional[Sequence[str]], namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: note:          @overload
+ misc/python/materialize/cli/mzcompose.py:681: note:          def [_N] parse_known_args(self, *, namespace: _N) -> tuple[_N, list[str]]
+ misc/python/materialize/cli/mzcompose.py:681: note:      Subclass:
+ misc/python/materialize/cli/mzcompose.py:681: note:          def parse_known_args(self, args: Optional[Sequence[str]] = ..., namespace: Optional[Namespace] = ...) -> tuple[Namespace, list[str]]

@AlexWaygood
Copy link
Member Author

I don't know why the PEP-561 test is failing -- looks like it's also failing on master, though: https://github.com/python/mypy/actions/runs/5279780403/jobs/9550964906

@JelleZijlstra
Copy link
Member

I don't know why the PEP-561 test is failing -- looks like it's also failing on master, though: https://github.com/python/mypy/actions/runs/5279780403/jobs/9550964906

Maybe setuptools or tox or something made a release that broke it? Opened #15446 to track.

@JelleZijlstra JelleZijlstra merged commit 9f3bbbe into python:master Jun 15, 2023
@AlexWaygood AlexWaygood deleted the mypybot/sync-typeshed branch June 15, 2023 16:04
JelleZijlstra pushed a commit that referenced this pull request Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants