Content-Length: 414304 | pFad | http://github.com/python/mypy/pull/19157

AD Drop support for --python-version 3.8 by cdce8p · Pull Request #19157 · python/mypy · GitHub
Skip to content

Drop support for --python-version 3.8 #19157

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 6 commits into from
May 28, 2025
Merged

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented May 27, 2025

Drop last remaining support for Python 3.8. Support for running with 3.8 was removed in #17492 already. This PR removes the option to use 3.8 with --python-version since the type stubs only support 3.9+, see #18930.

Copy link
Contributor

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

PyGithub (https://github.com/PyGithub/PyGithub)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)

antidote (https://github.com/Finistere/antidote)
- pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)
+ pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.9 or higher)

nox (https://github.com/wntrblm/nox)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)

jinja (https://github.com/pallets/jinja)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ src/jinja2/loaders.py:256: error: Returning Any from function declared to return "dict[str, object]"  [no-any-return]

PyWinCtl (https://github.com/Kalmat/PyWinCtl)
+ setup.cfg: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
- src/pywinctl/_pywinctl_linux.py:805: error: Returning Any from function declared to return "Optional[int]"  [no-any-return]
+ src/pywinctl/_pywinctl_linux.py:805: error: Returning Any from function declared to return "int | None"  [no-any-return]

boostedblob (https://github.com/hauntsaninja/boostedblob)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ boostedblob/boost.py:330: error: Value of type variable "_FT" of "wait" cannot be "Awaitable[T]"  [type-var]

itsdangerous (https://github.com/pallets/itsdangerous)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)

pywin32 (https://github.com/mhammond/pywin32)
+ mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)

scikit-build-core (https://github.com/scikit-build/scikit-build-core)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ src/scikit_build_core/settings/sources.py:591: error: Unused "type: ignore" comment  [unused-ignore]
+ src/scikit_build_core/settings/sources.py:604: error: Unused "type: ignore" comment  [unused-ignore]
+ src/scikit_build_core/builder/builder.py:132: error: Argument 1 to "_sanitize_path" has incompatible type "Traversable"; expected "PathLike[str]"  [arg-type]
+ tests/test_editable.py:247: error: Call to untyped function "_setup_package_for_editable_layout_tests" in typed context  [no-untyped-call]

packaging (https://github.com/pypa/packaging)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ src/packaging/tags.py:564: error: Unused "type: ignore" comment  [unused-ignore]

git-revise (https://github.com/mystor/git-revise)
+ mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)

paasta (https://github.com/yelp/paasta)
+ mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
+ paasta_tools/paastaapi/model/instance_status_kubernetes.py:227: SyntaxWarning: invalid escape sequence '\&'
+   evicted_count (int): Number of pods with status reason \"Evicted\". [optional]  # noqa: E501
- paasta_tools/metrics/metastatus_lib.py:617: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[_SlaveT], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"  [arg-type]
+ paasta_tools/metrics/metastatus_lib.py:617: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[tuple[str, str]]]"; expected "Callable[[_SlaveT], SupportsDunderLT[Any] | SupportsDunderGT[Any]]"  [arg-type]
- paasta_tools/metrics/metastatus_lib.py:617: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[Tuple[str, str]]]"; expected "Callable[[Any], Union[SupportsDunderLT[Any], SupportsDunderGT[Any]]]"  [arg-type]
+ paasta_tools/metrics/metastatus_lib.py:617: error: Argument "key" to "sorted" has incompatible type "Callable[[Any], Sequence[tuple[str, str]]]"; expected "Callable[[Any], SupportsDunderLT[Any] | SupportsDunderGT[Any]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:644: error: Argument 1 to "append" of "list" has incompatible type "Task[KubernetesAutoscalingStatusDict]"; expected "Future[Dict[str, Any]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:644: error: Argument 1 to "append" of "list" has incompatible type "Task[KubernetesAutoscalingStatusDict]"; expected "Future[dict[str, Any]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:656: error: Argument 1 to "append" of "list" has incompatible type "Task[Sequence[Any]]"; expected "Future[Dict[str, Any]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:656: error: Argument 1 to "append" of "list" has incompatible type "Task[Sequence[Any]]"; expected "Future[dict[str, Any]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:677: error: Argument 1 to "get_backends_from_mesh_status" has incompatible type "Task[Mapping[str, Any]]"; expected "Future[Dict[str, Any]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:677: error: Argument 1 to "get_backends_from_mesh_status" has incompatible type "Task[Mapping[str, Any]]"; expected "Future[dict[str, Any]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:679: error: List item 0 has incompatible type "Task[Mapping[str, Any]]"; expected "Future[Dict[str, Any]]"  [list-item]
+ paasta_tools/instance/kubernetes.py:679: error: List item 0 has incompatible type "Task[Mapping[str, Any]]"; expected "Future[dict[str, Any]]"  [list-item]
- paasta_tools/instance/kubernetes.py:679: error: List item 1 has incompatible type "Task[Set[str]]"; expected "Future[Dict[str, Any]]"  [list-item]
+ paasta_tools/instance/kubernetes.py:679: error: List item 1 has incompatible type "Task[set[str]]"; expected "Future[dict[str, Any]]"  [list-item]
- paasta_tools/instance/kubernetes.py:688: error: Argument 2 to "get_pod_status_tasks_by_sha_and_readiness" has incompatible type "Optional[Task[Set[str]]]"; expected "Future[Dict[str, Any]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:688: error: Argument 2 to "get_pod_status_tasks_by_sha_and_readiness" has incompatible type "Task[set[str]] | None"; expected "Future[dict[str, Any]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:699: error: Argument "pod_status_by_sha_and_readiness_task" to "get_versions_for_controller_revisions" has incompatible type "Task[defaultdict[Tuple[str, str], defaultdict[bool, List[Future[Dict[str, Any]]]]]]"; expected "Future[Mapping[Tuple[str, str], Mapping[bool, Sequence[Future[Mapping[str, Any]]]]]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:699: error: Argument "pod_status_by_sha_and_readiness_task" to "get_versions_for_controller_revisions" has incompatible type "Task[defaultdict[tuple[str, str], defaultdict[bool, list[Future[dict[str, Any]]]]]]"; expected "Future[Mapping[tuple[str, str], Mapping[bool, Sequence[Future[Mapping[str, Any]]]]]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:702: error: List item 0 has incompatible type "Task[defaultdict[Tuple[str, str], defaultdict[bool, List[Future[Dict[str, Any]]]]]]"; expected "Future[Dict[str, Any]]"  [list-item]
+ paasta_tools/instance/kubernetes.py:702: error: List item 0 has incompatible type "Task[defaultdict[tuple[str, str], defaultdict[bool, list[Future[dict[str, Any]]]]]]"; expected "Future[dict[str, Any]]"  [list-item]
- paasta_tools/instance/kubernetes.py:702: error: List item 1 has incompatible type "Task[List[KubernetesVersionDict]]"; expected "Future[Dict[str, Any]]"  [list-item]
+ paasta_tools/instance/kubernetes.py:702: error: List item 1 has incompatible type "Task[list[KubernetesVersionDict]]"; expected "Future[dict[str, Any]]"  [list-item]
- paasta_tools/instance/kubernetes.py:707: error: Argument 2 to "get_pod_status_tasks_by_replicaset" has incompatible type "Optional[Task[Set[str]]]"; expected "Future[Dict[str, Any]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:707: error: Argument 2 to "get_pod_status_tasks_by_replicaset" has incompatible type "Task[set[str]] | None"; expected "Future[dict[str, Any]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:718: error: Argument "pod_status_by_replicaset_task" to "get_versions_for_replicasets" has incompatible type "Task[Dict[str, List[Future[Dict[str, Any]]]]]"; expected "Future[Mapping[str, Sequence[Future[Dict[str, Any]]]]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:718: error: Argument "pod_status_by_replicaset_task" to "get_versions_for_replicasets" has incompatible type "Task[dict[str, list[Future[dict[str, Any]]]]]"; expected "Future[Mapping[str, Sequence[Future[dict[str, Any]]]]]"  [arg-type]
- paasta_tools/instance/kubernetes.py:721: error: List item 1 has incompatible type "Task[List[KubernetesVersionDict]]"; expected "Future[Dict[str, Any]]"  [list-item]
+ paasta_tools/instance/kubernetes.py:721: error: List item 1 has incompatible type "Task[list[KubernetesVersionDict]]"; expected "Future[dict[str, Any]]"  [list-item]
- paasta_tools/instance/kubernetes.py:1160: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Union[Generator[Any, None, Never], Coroutine[Any, Any, Never]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:1160: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Coroutine[Any, Any, Never]"  [arg-type]
- paasta_tools/instance/kubernetes.py:1338: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Union[Generator[Any, None, Never], Coroutine[Any, Any, Never]]"  [arg-type]
+ paasta_tools/instance/kubernetes.py:1338: error: Argument 1 to "create_task" has incompatible type "Awaitable[Sequence[Any]]"; expected "Coroutine[Any, Any, Never]"  [arg-type]
- paasta_tools/cli/cmds/local_run.py:980: error: Argument 1 to "write" of "_TextIOBase" has incompatible type "Union[str, bytes]"; expected "str"  [arg-type]
+ paasta_tools/cli/cmds/local_run.py:980: error: Argument 1 to "write" of "_TextIOBase" has incompatible type "str | bytes"; expected "str"  [arg-type]
- paasta_tools/cli/cmds/local_run.py:985: error: Argument 1 to "write" of "BufferedWriter" has incompatible type "Union[str, bytes]"; expected "Buffer"  [arg-type]
+ paasta_tools/cli/cmds/local_run.py:985: error: Argument 1 to "write" of "BufferedWriter" has incompatible type "str | bytes"; expected "Buffer"  [arg-type]

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
- rolemanagement/utils.py:61: error: Argument 2 of "update_roles_atomically" is incompatible with supertype "MixinMeta"; supertype defines the argument type as "Optional[List[Any]]"  [override]
+ rolemanagement/utils.py:61: error: Argument 2 of "update_roles_atomically" is incompatible with supertype "MixinMeta"; supertype defines the argument type as "list[Any] | None"  [override]
- rolemanagement/utils.py:61: error: Incompatible default for argument "give" (default has type "None", argument has type "List[Any]")  [assignment]
+ rolemanagement/utils.py:61: error: Incompatible default for argument "give" (default has type "None", argument has type "list[Any]")  [assignment]
- rolemanagement/utils.py:62: error: Argument 3 of "update_roles_atomically" is incompatible with supertype "MixinMeta"; supertype defines the argument type as "Optional[List[Any]]"  [override]
+ rolemanagement/utils.py:62: error: Argument 3 of "update_roles_atomically" is incompatible with supertype "MixinMeta"; supertype defines the argument type as "list[Any] | None"  [override]
- rolemanagement/utils.py:62: error: Incompatible default for argument "remove" (default has type "None", argument has type "List[Any]")  [assignment]
+ rolemanagement/utils.py:62: error: Incompatible default for argument "remove" (default has type "None", argument has type "list[Any]")  [assignment]
- rolemanagement/core.py:420: error: Item "str" of "Union[Any, str]" has no attribute "id"  [union-attr]
+ rolemanagement/core.py:420: error: Item "str" of "Any | str" has no attribute "id"  [union-attr]
- rolemanagement/core.py:492: error: Item "str" of "Union[Any, str]" has no attribute "id"  [union-attr]
+ rolemanagement/core.py:492: error: Item "str" of "Any | str" has no attribute "id"  [union-attr]

com2ann (https://github.com/ilevkivskyi/com2ann)
+ usage: mypy [-h] [-v] [-V] [more options; see below]
+             [-m MODULE] [-p PACKAGE] [-c PROGRAM_TEXT] [files ...]
+ mypy: error: argument --python-version: Python 3.8 is not supported (must be 3.9 or higher)

pybind11 (https://github.com/pybind/pybind11)
+ pyproject.toml: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)

dragonchain (https://github.com/dragonchain/dragonchain)
+ mypy.ini: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
- dragonchain/lib/database/redis.py:399:36: error: Argument 2 to "zadd" of "SortedSetCommands" has incompatible type "Dict[str, int]"; expected "Mapping[Union[str, bytes], Union[bytes, float, int, str]]"  [arg-type]
+ dragonchain/lib/database/redis.py:399:36: error: Argument 2 to "zadd" of "SortedSetCommands" has incompatible type "dict[str, int]"; expected "Mapping[str | bytes, bytes | float | int | str]"  [arg-type]
- dragonchain/lib/database/redis_utest.py:102:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[float, timedelta, None], Union[float, timedelta, None], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:106:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[float, timedelta, None], Union[float, timedelta, None], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:102:9: error: "Callable[[str | bytes, bytes | float | int | str, float | timedelta | None, float | timedelta | None, bool, bool, bool, bool, Any | None, Any | None], bool | None]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:106:9: error: "Callable[[str | bytes, bytes | float | int | str, float | timedelta | None, float | timedelta | None, bool, bool, bool, bool, Any | None, Any | None], bool | None]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:110:9: error: "Callable[[Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:110:9: error: "Callable[[str | bytes], Any | None]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:114:9: error: "Callable[[VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:114:9: error: "Callable[[VarArg(str | bytes)], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:122:9: error: "Callable[[bool, KwArg(Union[Any, Any])], bool]" has no attribute "assert_called_once"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:122:9: error: "Callable[[bool, KwArg(Any | Any)], bool]" has no attribute "assert_called_once"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:126:9: error: "Callable[[Union[str, bytes], VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:126:9: error: "Callable[[str | bytes, VarArg(str | bytes)], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:130:9: error: "Callable[[Union[bytes, float, int, str], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:130:9: error: "Callable[[bytes | float | int | str, VarArg(bytes | float | int | str)], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:134:9: error: "Callable[[Union[bytes, float, int, str], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:134:9: error: "Callable[[bytes | float | int | str, VarArg(bytes | float | int | str)], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:138:9: error: "Callable[[VarArg(Union[str, bytes])], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:138:9: error: "Callable[[VarArg(str | bytes)], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:150:9: error: "Callable[[Any, Any, Optional[int]], Any]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:150:9: error: "Callable[[Any, Any, int | None], Any]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:154:9: error: "Callable[[Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:154:9: error: "Callable[[str | bytes], Any | None]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:158:9: error: "Callable[[Union[str, bytes], int], Optional[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:158:9: error: "Callable[[str | bytes, int], Any | None]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:162:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str], Union[float, timedelta, None], Union[float, timedelta, None], bool, bool, bool, bool, Optional[Any], Optional[Any]], Optional[bool]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:162:9: error: "Callable[[str | bytes, bytes | float | int | str, float | timedelta | None, float | timedelta | None, bool, bool, bool, bool, Any | None, Any | None], bool | None]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:166:9: error: "Callable[[Union[str, bytes], int, int], bool]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:166:9: error: "Callable[[str | bytes, int, int], bool]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:170:9: error: "Callable[[Union[str, bytes], Union[str, bytes]], Optional[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:170:9: error: "Callable[[str | bytes, str | bytes], Any | None]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:174:9: error: "Callable[[Union[str, bytes], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:174:9: error: "Callable[[str | bytes, VarArg(bytes | float | int | str)], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:178:9: error: "Callable[[Union[str, bytes], Union[bytes, float, int, str]], bool]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:178:9: error: "Callable[[str | bytes, bytes | float | int | str], bool]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:182:9: error: "Callable[[Union[str, bytes]], Set[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:182:9: error: "Callable[[str | bytes], set[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:186:9: error: "Callable[[Union[str, bytes], VarArg(Union[bytes, float, int, str])], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:186:9: error: "Callable[[str | bytes, VarArg(bytes | float | int | str)], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:190:9: error: "Callable[[Union[str, bytes], int, int], List[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:190:9: error: "Callable[[str | bytes, int, int], list[Any]]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:198:9: error: "Callable[[Union[str, bytes]], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:198:9: error: "Callable[[str | bytes], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:206:9: error: "Callable[[Any, Optional[int]], Any]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:206:9: error: "Callable[[Any, int | None], Any]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:210:9: error: "Callable[[Union[str, bytes]], Dict[Any, Any]]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:210:9: error: "Callable[[str | bytes], dict[Any, Any]]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:214:9: error: "Callable[[Union[str, bytes], Union[str, bytes]], bool]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:214:9: error: "Callable[[str | bytes, str | bytes], bool]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/database/redis_utest.py:217:35: error: Argument 2 to "zadd_sync" has incompatible type "str"; expected "Dict[str, int]"  [arg-type]
+ dragonchain/lib/database/redis_utest.py:217:35: error: Argument 2 to "zadd_sync" has incompatible type "str"; expected "dict[str, int]"  [arg-type]
- dragonchain/lib/database/redis_utest.py:218:9: error: "Callable[[Union[str, bytes], Mapping[Union[str, bytes], Union[bytes, float, int, str]], bool, bool, bool, bool, Optional[Any], Optional[Any]], int]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/database/redis_utest.py:218:9: error: "Callable[[str | bytes, Mapping[str | bytes, bytes | float | int | str], bool, bool, bool, bool, Any | None, Any | None], int]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/lib/interfaces/storage_utest.py:83:9: error: "Callable[[str, Union[str, bytes], Optional[int], str], bool]" has no attribute "assert_called_once_with"  [attr-defined]
+ dragonchain/lib/interfaces/storage_utest.py:83:9: error: "Callable[[str, str | bytes, int | None, str], bool]" has no attribute "assert_called_once_with"  [attr-defined]
- dragonchain/broadcast_processor/broadcast_functions.py:95:32: error: Item "None" of "Optional[Match[str]]" has no attribute "group"  [union-attr]
+ dragonchain/broadcast_processor/broadcast_functions.py:95:32: error: Item "None" of "Match[str] | None" has no attribute "group"  [union-attr]
- dragonchain/lib/authorization.py:315:19: error: Item "None" of "Optional[Match[str]]" has no attribute "group"  [union-attr]
+ dragonchain/lib/authorization.py:315:19: error: Item "None" of "Match[str] | None" has no attribute "group"  [union-attr]
- dragonchain/lib/authorization.py:317:25: error: Item "None" of "Optional[Match[str]]" has no attribute "group"  [union-attr]
+ dragonchain/lib/authorization.py:317:25: error: Item "None" of "Match[str] | None" has no attribute "group"  [union-attr]
- dragonchain/lib/authorization.py:340:31: error: Item "None" of "Optional[Match[str]]" has no attribute "group"  [union-attr]
+ dragonchain/lib/authorization.py:340:31: error: Item "None" of "Match[str] | None" has no attribute "group"  [union-attr]
- dragonchain/webserver/helpers_utest.py:259:9: error: Need type annotation for "input_dict" (hint: "input_dict: Dict[<type>, <type>] = ...")  [var-annotated]
+ dragonchain/webserver/helpers_utest.py:259:9: error: Need type annotation for "input_dict" (hint: "input_dict: dict[<type>, <type>] = ...")  [var-annotated]
- dragonchain/webserver/lib/verifications.py:85:12: error: Incompatible return value type (got "Optional[Any]", expected "str")  [return-value]
+ dragonchain/webserver/lib/verifications.py:85:12: error: Incompatible return value type (got "Any | None", expected "str")  [return-value]
- dragonchain/webserver/lib/api_keys_utest.py:48:87: error: Argument "permissions_document" to "create_api_key_v1" has incompatible type "Dict[str, str]"; expected "Optional[permissions_doc]"  [arg-type]
+ dragonchain/webserver/lib/api_keys_utest.py:48:87: error: Argument "permissions_document" to "create_api_key_v1" has incompatible type "dict[str, str]"; expected "permissions_doc | None"  [arg-type]
- dragonchain/webserver/lib/api_keys_utest.py:91:59: error: Argument 3 to "update_api_key_v1" has incompatible type "Dict[str, str]"; expected "Optional[permissions_doc]"  [arg-type]
+ dragonchain/webserver/lib/api_keys_utest.py:91:59: error: Argument 3 to "update_api_key_v1" has incompatible type "dict[str, str]"; expected "permissions_doc | None"  [arg-type]
- dragonchain/transaction_processor/level_5_actions_utest.py:199:55: error: Argument 1 to "verify_blocks" has incompatible type "List[str]"; expected "Iterable[bytes]"  [arg-type]
+ dragonchain/transaction_processor/level_5_actions_utest.py:199:55: error: Argument 1 to "verify_blocks" has incompatible type "list[str]"; expected "Iterable[bytes]"  [arg-type]
- dragonchain/transaction_processor/level_4_actions_utest.py:73:50: error: Argument 1 to "verify_blocks" has incompatible type "List[MagicMock]"; expected "List[L3BlockModel]"  [arg-type]
+ dragonchain/transaction_processor/level_4_actions_utest.py:73:50: error: Argument 1 to "verify_blocks" has incompatible type "list[MagicMock]"; expected "list[L3BlockModel]"  [arg-type]
- dragonchain/transaction_processor/level_3_actions_utest.py:247:86: error: Argument 2 to "verify_blocks" has incompatible type "Dict[str, str]"; expected "L1Headers"  [arg-type]
+ dragonchain/transaction_processor/level_3_actions_utest.py:247:86: error: Argument 2 to "verify_blocks" has incompatible type "dict[str, str]"; expected "L1Headers"  [arg-type]
- dragonchain/transaction_processor/level_2_actions_utest.py:104:9: error: Need type annotation for "txn_map" (hint: "txn_map: Dict[<type>, <type>] = ...")  [var-annotated]
+ dragonchain/transaction_processor/level_2_actions_utest.py:104:9: error: Need type annotation for "txn_map" (hint: "txn_map: dict[<type>, <type>] = ...")  [var-annotated]
- dragonchain/transaction_processor/level_2_actions_utest.py:117:9: error: Need type annotation for "txn_map" (hint: "txn_map: Dict[<type>, <type>] = ...")  [var-annotated]
+ dragonchain/transaction_processor/level_2_actions_utest.py:117:9: error: Need type annotation for "txn_map" (hint: "txn_map: dict[<type>, <type>] = ...")  [var-annotated]
- dragonchain/transaction_processor/level_2_actions_utest.py:178:9: error: Need type annotation for "txn_map" (hint: "txn_map: Dict[<type>, <type>] = ...")  [var-annotated]
+ dragonchain/transaction_processor/level_2_actions_utest.py:178:9: error: Need type annotation for "txn_map" (hint: "txn_map: dict[<type>, <type>] = ...")  [var-annotated]
- dragonchain/transaction_processor/level_2_actions_utest.py:188:9: error: Need type annotation for "txn_map" (hint: "txn_map: Dict[<type>, <type>] = ...")  [var-annotated]
+ dragonchain/transaction_processor/level_2_actions_utest.py:188:9: error: Need type annotation for "txn_map" (hint: "txn_map: dict[<type>, <type>] = ...")  [var-annotated]
- dragonchain/transaction_processor/level_1_actions_utest.py:132:39: error: List item 0 has incompatible type "Dict[str, str]"; expected "TransactionModel"  [list-item]
+ dragonchain/transaction_processor/level_1_actions_utest.py:132:39: error: List item 0 has incompatible type "dict[str, str]"; expected "TransactionModel"  [list-item]
- dragonchain/transaction_processor/level_1_actions_utest.py:132:58: error: List item 1 has incompatible type "Dict[str, str]"; expected "TransactionModel"  [list-item]
+ dragonchain/transaction_processor/level_1_actions_utest.py:132:58: error: List item 1 has incompatible type "dict[str, str]"; expected "TransactionModel"  [list-item]
- dragonchain/job_processor/contract_job_utest.py:199:38: error: Incompatible types in assignment (expression has type "Dict[str, str]", variable has type "SmartContractModel")  [assignment]
+ dragonchain/job_processor/contract_job_utest.py:199:38: error: Incompatible types in assignment (expression has type "dict[str, str]", variable has type "SmartContractModel")  [assignment]
- dragonchain/job_processor/contract_job_utest.py:269:13: error: "Callable[[Union[str, ContractState], str], None]" has no attribute "assert_called_once"  [attr-defined]

... (truncated 1 lines) ...

manticore (https://github.com/trailofbits/manticore)
- mypy.ini: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)
+ mypy.ini: [mypy]: python_version: Python 3.7 is not supported (must be 3.9 or higher)

Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@hauntsaninja hauntsaninja merged commit 3801b7f into python:master May 28, 2025
18 checks passed
@cdce8p cdce8p deleted the drop-3.8 branch May 28, 2025 08:41
@JelleZijlstra
Copy link
Member

We should probably drop/update the primer projects complaining about this

@JelleZijlstra
Copy link
Member

Though I guess it's nonblocking? com2ann at least seems like it's not doing any type checking though.

@JukkaL
Copy link
Collaborator

JukkaL commented May 28, 2025

If it's a blocking error to target an unsupported Python version, maybe it's not hard to make it a non-blocking error, and we wouldn't need to remove projects from mypy_primer.

@cdce8p
Copy link
Collaborator Author

cdce8p commented May 28, 2025

If it's a blocking error to target an unsupported Python version, maybe it's not hard to make it a non-blocking error, and we wouldn't need to remove projects from mypy_primer.

It's only blocking if supplied as cmd argument. If parsed from a config file, mypy will default to the interpreter version for python_version. I'm currently preparing a PR to optimize that. I.e. if a project used to specify python_version = 3.8 we should only bump it to the min supported version after version drop. This will revert the error message changes related to the new union syntax. E.g.:

PyWinCtl (https://github.com/Kalmat/PyWinCtl)
+ setup.cfg: [mypy]: python_version: Python 3.8 is not supported (must be 3.9 or higher)
- src/pywinctl/_pywinctl_linux.py:805: error: Returning Any from function declared to return "Optional[int]"  [no-any-return]
+ src/pywinctl/_pywinctl_linux.py:805: error: Returning Any from function declared to return "int | None"  [no-any-return]

@cdce8p
Copy link
Collaborator Author

cdce8p commented May 28, 2025

com2ann at least seems like it's not doing any type checking though.

This should be fixed with hauntsaninja/mypy_primer#177.

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.

4 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/python/mypy/pull/19157

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy