Skip to content

Sync typeshed - #15681

Merged
hauntsaninja merged 5 commits into
python:masterfrom
AlexWaygood:mypybot/sync-typeshed
Jul 15, 2023
Merged

hauntsaninja merged 5 commits into
python:masterfrom
AlexWaygood:mypybot/sync-typeshed

Conversation

@AlexWaygood

@AlexWaygood AlexWaygood commented Jul 15, 2023 •

Copy link
Copy Markdown
Member

Source commit: python/typeshed@a83e559

More merge conflicts meant the automated PR failed last night: https://github.com/python/mypy/actions/runs/5559314225

⚠️ 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 July 15, 2023 11:38
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
Copy Markdown
Contributor

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

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/utilities/templating.py:143: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]
- src/prefect/utilities/templating.py:145: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]
- src/prefect/utilities/templating.py:294: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]
- src/prefect/utilities/templating.py:296: error: Incompatible types in assignment (expression has type "str", variable has type "dict[Any, Any]")  [assignment]

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/config_test.py:619:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "return_value"  [attr-defined]
+ lib/tests/streamlit/config_test.py:619:9: error: "_patch_default_new" has no attribute "return_value"  [attr-defined]
- lib/tests/streamlit/config_test.py:621:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "side_effect"  [attr-defined]
+ lib/tests/streamlit/config_test.py:621:9: error: "_patch_default_new" has no attribute "side_effect"  [attr-defined]
- lib/tests/streamlit/config_test.py:645:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "return_value"  [attr-defined]
+ lib/tests/streamlit/config_test.py:645:9: error: "_patch_default_new" has no attribute "return_value"  [attr-defined]
- lib/tests/streamlit/config_test.py:647:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "side_effect"  [attr-defined]
+ lib/tests/streamlit/config_test.py:647:9: error: "_patch_default_new" has no attribute "side_effect"  [attr-defined]
- lib/tests/streamlit/config_test.py:683:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "return_value"  [attr-defined]
+ lib/tests/streamlit/config_test.py:683:9: error: "_patch_default_new" has no attribute "return_value"  [attr-defined]
- lib/tests/streamlit/config_test.py:685:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "side_effect"  [attr-defined]
+ lib/tests/streamlit/config_test.py:685:9: error: "_patch_default_new" has no attribute "side_effect"  [attr-defined]
- lib/tests/streamlit/config_test.py:731:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "return_value"  [attr-defined]
+ lib/tests/streamlit/config_test.py:731:9: error: "_patch_default_new" has no attribute "return_value"  [attr-defined]
- lib/tests/streamlit/config_test.py:733:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "side_effect"  [attr-defined]
+ lib/tests/streamlit/config_test.py:733:9: error: "_patch_default_new" has no attribute "side_effect"  [attr-defined]
- lib/tests/streamlit/config_test.py:757:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "return_value"  [attr-defined]
+ lib/tests/streamlit/config_test.py:757:9: error: "_patch_default_new" has no attribute "return_value"  [attr-defined]
- lib/tests/streamlit/config_test.py:759:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "side_effect"  [attr-defined]
+ lib/tests/streamlit/config_test.py:759:9: error: "_patch_default_new" has no attribute "side_effect"  [attr-defined]
- lib/tests/streamlit/config_test.py:793:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "return_value"  [attr-defined]
+ lib/tests/streamlit/config_test.py:793:9: error: "_patch_default_new" has no attribute "return_value"  [attr-defined]
- lib/tests/streamlit/config_test.py:795:9: error: "_patch[Union[MagicMock, AsyncMock]]" has no attribute "side_effect"  [attr-defined]
+ lib/tests/streamlit/config_test.py:795:9: error: "_patch_default_new" has no attribute "side_effect"  [attr-defined]

@AlexWaygood

Copy link
Copy Markdown
Member Author

The prefect change is due to python/typeshed@81b8211 (which is the commit that caused the merge conflict in the automated PR, FYI).

The streamlit change is just a slightly different error message, caused by python/typeshed@7ea173c.

@hauntsaninja
hauntsaninja merged commit 3240da4 into python:master Jul 15, 2023
@AlexWaygood
AlexWaygood deleted the mypybot/sync-typeshed branch July 15, 2023 19:59
svalentin pushed a commit that referenced this pull request Jul 19, 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.

2 participants