Skip to content

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.

hauntsaninjaand others added 2 commits July 8, 2022 23:14
Fixespython#13091 Co-authored-by: Ivan Levkivskyi <ilevkivskyi@dropbox.com>
@hauntsaninja
Copy link
CollaboratorAuthor

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

@hauntsaninjahauntsaninja 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
CollaboratorAuthor

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

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
CollaboratorAuthor

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

@hauntsaninjahauntsaninja merged commit 3ae19a2 into python:masterJul 8, 2022
@hauntsaninjahauntsaninja 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 freeto 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

@hauntsaninja@JelleZijlstra@ilevkivskyi