Skip to content
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

Unsupport targetting 3.7. #16883

Merged
merged 3 commits into from
Feb 10, 2024
Merged

Unsupport targetting 3.7. #16883

merged 3 commits into from
Feb 10, 2024

Conversation

jhance
Copy link
Collaborator

@jhance jhance commented Feb 6, 2024

This syncs up this constant to the actual minimum version that typeshed is now targetting.

This comment has been minimized.

@JelleZijlstra
Copy link
Member

Seems like the antidote changes are because we previously showed a blocking syntax error for a pos-only parameter, and now we show all the other errors we detect there. The mypy-primer output generally looks fine.

@JelleZijlstra
Copy link
Member

You need to make a few trivial updates to the tests

@jhance
Copy link
Collaborator Author

jhance commented Feb 7, 2024

I only checked pytest-fast locally, but it seems yeah there are some of the slower ones that need to be fixed. I'll fix that up tomorrow.

@cdce8p
Copy link
Collaborator

cdce8p commented Feb 7, 2024

Just looked at the failing tests. It doesn't need much. Opened a PR against your branch. Feel free to merge it if you like.

Copy link
Contributor

github-actions bot commented Feb 9, 2024

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

jinja (https://github.com/pallets/jinja)
+ pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)
- src/jinja2/debug.py:130: error: Argument 6 to "CodeType" has incompatible type "bytes"; expected "int"  [arg-type]
- src/jinja2/debug.py:131: error: Argument 7 to "CodeType" has incompatible type "Tuple[Any, ...]"; expected "bytes"  [arg-type]
- src/jinja2/debug.py:134: error: Argument 10 to "CodeType" has incompatible type "str"; expected "Tuple[str, ...]"  [arg-type]
- src/jinja2/debug.py:136: error: Argument 12 to "CodeType" has incompatible type "int"; expected "str"  [arg-type]
- src/jinja2/debug.py:137: error: Argument 13 to "CodeType" has incompatible type "bytes"; expected "int"  [arg-type]
- src/jinja2/debug.py:138: error: Argument 14 to "CodeType" has incompatible type "Tuple[str, ...]"; expected "bytes"  [arg-type]

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

antidote (https://github.com/Finistere/antidote)
- tests/core/test_inject_py38.py:16: error: Positional-only parameters are only supported in Python 3.8 and greater  [syntax]
+ pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)
+ setup.py:4: error: Skipping analyzing "setuptools": module is installed, but missing library stubs or py.typed marker  [import-untyped]
+ src/antidote/core/_wiring.py:15: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_wiring.py:15: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_wiring.py:15: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_wiring.py:15: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/_injection.py:278: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_injection.py:278: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_injection.py:278: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_injection.py:278: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/_catalog.py:265: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/core/_inject.py:43: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:43: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:43: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:43: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:93: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:93: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:93: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:93: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:132: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:132: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:141: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:141: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/_inject.py:147: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:147: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/_inject.py:156: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/_inject.py:156: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/__init__.py:144: error: Overloaded function signatures 5 and 6 overlap with incompatible return types  [overload-overlap]
+ src/antidote/core/__init__.py:197: error: Overloaded function signatures 2 and 3 overlap with incompatible return types  [overload-overlap]
+ src/antidote/core/__init__.py:398: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/core/__init__.py:985: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:985: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/__init__.py:985: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:985: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/__init__.py:1033: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1033: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/__init__.py:1042: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1042: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/core/__init__.py:1048: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1048: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/core/__init__.py:1057: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/core/__init__.py:1057: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:104: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:104: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:110: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/_lazy.py:110: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:210: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:210: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:216: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:216: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:499: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:499: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:505: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:505: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:635: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/lazy_ext/__init__.py:635: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/_function.py:76: error: Unused "type: ignore" comment  [unused-ignore]
+ src/antidote/lib/interface_ext/_interface.py:78: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/_interface.py:118: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/_interface.py:257: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/_interface.py:257: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:357: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:396: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:576: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:576: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1014: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1017: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1026: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1029: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1035: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1068: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1207: error: Overloaded function signatures 1 and 2 overlap with incompatible return types  [overload-overlap]
+ src/antidote/lib/interface_ext/__init__.py:1237: error: "classmethod" expects 3 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1237: error: Missing type parameters for generic type "classmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1241: error: "staticmethod" expects 2 type arguments, but 1 given  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1241: error: Missing type parameters for generic type "staticmethod"  [type-arg]
+ src/antidote/lib/interface_ext/__init__.py:1263: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1263: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1266: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1266: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1278: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1278: note: If the method is meant to be abstract, use @abc.abstractmethod
+ src/antidote/lib/interface_ext/__init__.py:1281: error: Missing return statement  [empty-body]
+ src/antidote/lib/interface_ext/__init__.py:1281: note: If the method is meant to be abstract, use @abc.abstractmethod

... (truncated 123 lines) ...

manticore (https://github.com/trailofbits/manticore)
+ mypy.ini: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)
- tests/auto_generators/make_dump.py:423: error: Invalid index type "int" for "Dict[str, Any]"; expected type "str"  [index]
+ tests/auto_generators/make_dump.py:423: error: Invalid index type "int" for "dict[str, Any]"; expected type "str"  [index]
- tests/wasm/json2mc.py:103: note:     def __getitem__(self, slice, /) -> List[Any]
+ tests/wasm/json2mc.py:103: note:     def __getitem__(self, slice, /) -> list[Any]
- tests/wasm/json2mc.py:159: error: Invalid index type "Optional[int]" for "List[Module]"; expected type "SupportsIndex"  [index]
+ tests/wasm/json2mc.py:159: error: Invalid index type "int | None" for "list[Module]"; expected type "SupportsIndex"  [index]
- tests/wasm/json2mc.py:161: error: Invalid index type "Optional[int]" for "List[Module]"; expected type "SupportsIndex"  [index]
+ tests/wasm/json2mc.py:161: error: Invalid index type "int | None" for "list[Module]"; expected type "SupportsIndex"  [index]
- manticore/core/workspace.py:220: error: Argument 1 to "exists" has incompatible type "Optional[str]"; expected "Union[int, Union[str, bytes, PathLike[str], PathLike[bytes]]]"  [arg-type]
+ manticore/core/workspace.py:220: error: Argument 1 to "exists" has incompatible type "str | None"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
- manticore/core/workspace.py:221: error: Argument 1 to "isdir" has incompatible type "Optional[str]"; expected "Union[int, Union[str, bytes, PathLike[str], PathLike[bytes]]]"  [arg-type]
+ manticore/core/workspace.py:221: error: Argument 1 to "isdir" has incompatible type "str | None"; expected "int | str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]
- manticore/core/workspace.py:223: error: Argument 1 to "mkdir" has incompatible type "Optional[str]"; expected "Union[str, bytes, PathLike[str], PathLike[bytes]]"  [arg-type]
+ manticore/core/workspace.py:223: error: Argument 1 to "mkdir" has incompatible type "str | None"; expected "str | bytes | PathLike[str] | PathLike[bytes]"  [arg-type]

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

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

spack (https://github.com/spack/spack)
+ pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher). You may need to put quotes around your Python version
- lib/spack/spack/oci/oci.py:142: error: Argument 1 to "endpoint" of "ImageReference" has incompatible type "Optional[str]"; expected "str"  [arg-type]
+ lib/spack/spack/oci/oci.py:142: error: Argument 1 to "endpoint" of "ImageReference" has incompatible type "str | None"; expected "str"  [arg-type]
+ lib/spack/spack/install_test.py:412: error: Unused "type: ignore" comment  [unused-ignore]
+ lib/spack/spack/install_test.py:860: error: Unused "type: ignore" comment  [unused-ignore]

PyWinCtl (https://github.com/Kalmat/PyWinCtl)
+ setup.cfg: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)

pybind11 (https://github.com/pybind/pybind11)
+ pyproject.toml: [mypy]: python_version: Python 3.7 is not supported (must be 3.8 or higher)
+ setup.py:99: error: Class cannot subclass "sdist" (has type "Any")  [misc]
- /tmp/mypy_primer/projects/_pybind11_venv/lib/python3.10/site-packages/markdown_it/common/utils.py:106: error: Assignment expressions are only supported in Python 3.8 and greater  [syntax]
+ pybind11/setup_helpers.py:69: error: Unused "type: ignore" comment  [unused-ignore]
+ pybind11/setup_helpers.py:72: error: Unused "type: ignore" comment  [unused-ignore]
+ pybind11/setup_helpers.py:89: error: Class cannot subclass "_Extension" (has type "Any")  [misc]
+ pybind11/setup_helpers.py:271: error: Class cannot subclass "_build_ext" (has type "Any")  [misc]
+ pybind11/setup_helpers.py:496: error: Argument 1 to "append" of "list" has incompatible type "Callable[[CCompiler, list[str], str | None, list[tuple[str] | tuple[str, str | None]] | None, list[str] | None, bool, list[str] | None, list[str] | None, list[str] | None], list[str]]"; expected "Callable[[CCompiler, list[str], str | None, tuple[str] | tuple[str, str | None] | None, list[str] | None, bool, list[str] | None, list[str] | None, list[str] | None], list[str]]"  [arg-type]

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

@jhance jhance merged commit d8e3d59 into python:master Feb 10, 2024
18 checks passed
cdce8p pushed a commit to cdce8p/mypy that referenced this pull request Feb 10, 2024
This syncs up this constant to the actual minimum version that typeshed
is now targetting.

---------

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
(cherry picked from commit d8e3d59)
@cdce8p
Copy link
Collaborator

cdce8p commented Feb 10, 2024

Opened #16900 for the cherry-pick onto the release branch.

JelleZijlstra pushed a commit that referenced this pull request Feb 10, 2024
This syncs up this constant to the actual minimum version that typeshed
is now targetting.

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
(cherry picked from commit d8e3d59)

Co-authored-by: jhance <jhance@users.noreply.github.com>
@cdce8p cdce8p mentioned this pull request Mar 1, 2024
bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull request Mar 25, 2024
https://build.opensuse.org/request/show/1160713
by user mcepl + anag+factory
- Clean up SPEC file.
New upstream release 1.9.0
#### Breaking Changes
Because the version of typeshed we use in mypy 1.9 doesn't support 3.7, neither does mypy 1.9. (Jared Hance, PR [16883](python/mypy#16883))
We are planning to enable
[local partial types](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-local-partial-types) (enabled via the
`--local-partial-types` flag) later this year by default. This change
was announced years ago, but now it's finally happening. This is a
major backward-incompatible change, so we'll probably include it as
part of the upcoming mypy 2.0 release. This makes daemon and
non-daemon mypy runs have the same behavior by default.
Local partial types can also be enabled in the mypy config file:
```
local_partial_type
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