Skip to content

Sync typeshed #13097

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 3 commits into from
Jul 8, 2022
Merged

Sync typeshed #13097

merged 3 commits into from
Jul 8, 2022

Conversation

hauntsaninja
Copy link
Collaborator

Source commit:
python/typeshed@b145b32

This reapplies #13093. This will likely be the last sync that still has support for Python 3.6.

hauntsaninja and others added 2 commits July 8, 2022 23:14
@hauntsaninja
Copy link
Collaborator Author

Looks like we have some failures from python/typeshed#7454 (comment)

@hauntsaninja hauntsaninja marked this pull request as ready for review July 8, 2022 18:06
@JelleZijlstra
Copy link
Member

Looks like we have some failures from python/typeshed#7454 (comment)

I didn't realize that change would cause mypy trouble. It's pretty low-value, so I'd be OK with just reverting the typeshed change.

@hauntsaninja
Copy link
Collaborator Author

Eh, whatever. I already did the hard bit for that change in #12319 and there aren't any other primer hits for this.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

github-actions bot commented Jul 8, 2022

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

psycopg (https://github.com/psycopg/psycopg)
+ tests/test_psycopg_dbapi20.py:43: error: Unused "type: ignore" comment
+ tests/test_psycopg_dbapi20.py:44: error: Unused "type: ignore" comment

mypy (https://github.com/python/mypy)
+ mypy/config_parser.py:182: error: Argument 1 to "map" has incompatible type overloaded function; expected "Callable[[str], AnyStr]"  [arg-type]

rotki (https://github.com/rotki/rotki)
+ rotkehlchen/db/drivers/gevent.py:166: error: Unused "type: ignore" comment

paasta (https://github.com/yelp/paasta)
- paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT, SupportsDunderGT]]"
+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"
- paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT, SupportsDunderGT]]"
+ paasta_tools/metrics/metastatus_lib.py:672: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"

poetry (https://github.com/python-poetry/poetry)
- src/poetry/packages/locker.py:314: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ src/poetry/packages/locker.py:314: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]
- src/poetry/packages/locker.py:506: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ src/poetry/packages/locker.py:506: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]
- src/poetry/puzzle/solver.py:137: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ src/poetry/puzzle/solver.py:137: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]
- src/poetry/console/commands/show.py:390: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ src/poetry/console/commands/show.py:390: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]
- src/poetry/console/commands/show.py:434: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ src/poetry/console/commands/show.py:434: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/httpclient_test.py:693: error: Argument 1 to "assertGreaterEqual" of "TestCase" has incompatible type "Optional[float]"; expected "SupportsDunderGE[int]"
+ tornado/test/httpclient_test.py:694: error: Argument 1 to "assertLess" of "TestCase" has incompatible type "Optional[float]"; expected "SupportsDunderLT[float]"

pytest (https://github.com/pytest-dev/pytest)
+ src/_pytest/recwarn.py:160: error: Missing type parameters for generic type "catch_warnings"  [type-arg]

ibis (https://github.com/ibis-project/ibis)
- ibis/common/dispatch.py:90: error: Argument "key" to "max" has incompatible type "Callable[[Tuple[Any, Any]], Optional[Any]]"; expected "Callable[[Tuple[Any, Any]], Union[SupportsDunderLT, SupportsDunderGT]]"
+ ibis/common/dispatch.py:90: error: Argument "key" to "max" has incompatible type "Callable[[Tuple[Any, Any]], Optional[Any]]"; expected "Callable[[Tuple[Any, Any]], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"
- ibis/common/dispatch.py:90: error: Incompatible return value type (got "Optional[Any]", expected "Union[SupportsDunderLT, SupportsDunderGT]")
+ ibis/common/dispatch.py:90: error: Incompatible return value type (got "Optional[Any]", expected "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]")

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/watcher/local_sources_watcher_test.py:375:47: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ lib/tests/streamlit/watcher/local_sources_watcher_test.py:375:47: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]

core (https://github.com/home-assistant/core)
- homeassistant/components/zwave_js/device_condition.py:225: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ homeassistant/components/zwave_js/device_condition.py:225: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]
- homeassistant/components/zwave_js/device_action.py:330: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ homeassistant/components/zwave_js/device_action.py:330: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]
- homeassistant/components/zwave_js/device_trigger.py:538: error: Returning Any from function declared to return "Union[SupportsDunderLT, SupportsDunderGT]"  [no-any-return]
+ homeassistant/components/zwave_js/device_trigger.py:538: error: Returning Any from function declared to return "Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]"  [no-any-return]

discord.py (https://github.com/Rapptz/discord.py)
- discord/guild.py:545: error: Need type annotation for "empty_tuple"
- discord/ext/tasks/__init__.py:494: error: Incompatible types in assignment (expression has type "Tuple[<nothing>, ...]", variable has type "Tuple[Type[OSError], Type[GatewayNotFound], Type[ConnectionClosed], Type[ClientError], Type[TimeoutError]]")
+ discord/ext/tasks/__init__.py:494: error: Incompatible types in assignment (expression has type "Tuple[]", variable has type "Tuple[Type[OSError], Type[GatewayNotFound], Type[ConnectionClosed], Type[ClientError], Type[TimeoutError]]")

@hauntsaninja
Copy link
Collaborator Author

We've discussed the mypy-primer hit on mypy already.

tornado is python/typeshed#8077 (comment)

pytest is python/typeshed#8229

All in all, I think this is safe to merge

@hauntsaninja hauntsaninja merged commit 3ae19a2 into python:master Jul 8, 2022
@hauntsaninja hauntsaninja deleted the sync branch July 8, 2022 18:51
Gobot1234 pushed a commit to Gobot1234/mypy that referenced this pull request Aug 12, 2022
Source commit:
python/typeshed@b145b32

This reapplies python#13093. This will likely be the last sync that still has support for Python 3.6.
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