Skip to content

Sync typeshed #15681

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

Merged
merged 5 commits into from
Jul 15, 2023
Merged

Sync typeshed #15681

merged 5 commits into from
Jul 15, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Jul 15, 2023

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
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
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