diff --git a/pydantic/generics.py b/pydantic/generics.py index b2bb79d..ab3ea52 100644 --- a/pydantic/generics.py +++ b/pydantic/generics.py @@ -1,7 +1,7 @@ from typing import Any, ClassVar, Dict, Generic, Tuple, Type, TypeVar, Union, get_type_hints -from pydantic import BaseModel, create_model from pydantic.class_validators import gather_validators +from pydantic.main import BaseModel, create_model _generic_types_cache: Dict[Tuple[Type[Any], Union[Any, Tuple[Any, ...]]], Type[BaseModel]] = {} GenericModelT = TypeVar('GenericModelT', bound='GenericModel') diff --git a/pydantic/types.py b/pydantic/types.py index c8f4df1..6ad2096 100644 --- a/pydantic/types.py +++ b/pydantic/types.py @@ -238,7 +238,7 @@ class PyObject: class ConstrainedNumberMeta(type): - def __new__(cls, name: str, bases: Any, dct: Dict[str, Any]) -> 'ConstrainedInt': + def __new__(cls, name: str, bases: Any, dct: Dict[str, Any]) -> 'ConstrainedInt': # type: ignore new_cls = cast('ConstrainedInt', type.__new__(cls, name, bases, dct)) if new_cls.gt is not None and new_cls.ge is not None: diff --git a/tests/mypy/mypy-default.ini b/tests/mypy/mypy-default.ini index c55bfa4..09c1176 100644 --- a/tests/mypy/mypy-default.ini +++ b/tests/mypy/mypy-default.ini @@ -5,7 +5,7 @@ warn_redundant_casts = True warn_unused_ignores = True disallow_any_generics = True check_untyped_defs = True -no_implicit_reexport = True +;no_implicit_reexport = True # for strict mypy: (this is the tricky one :-)) disallow_untyped_defs = True diff --git a/tests/requirements.txt b/tests/requirements.txt index 1db4266..272ec1f 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -5,7 +5,7 @@ Cython==0.29.13;sys_platform!='win32' flake8==3.7.8 flake8-quotes==2.1.0 isort==4.3.21 -mypy==0.720 +mypy==0.730 pycodestyle==2.5.0 pyflakes==2.1.1 pytest==5.1.3 diff --git a/tests/test_mypy.py b/tests/test_mypy.py index d75b6dc..a730e0a 100644 --- a/tests/test_mypy.py +++ b/tests/test_mypy.py @@ -37,7 +37,7 @@ expected_successes = [('tests/mypy/success.py', ('', '', 0))] @pytest.mark.skipif(not typing_extensions, reason='typing_extensions not installed') @pytest.mark.parametrize('filename,expected_result', expected_successes + expected_fails) def test_mypy_results(filename, expected_result): - actual_result = api.run([filename, '--config-file', 'tests/mypy/mypy-default.ini']) + actual_result = api.run([filename, '--config-file', 'tests/mypy/mypy-default.ini', '--no-error-summary']) expected_out, expected_err, expected_returncode = expected_result actual_out, actual_err, actual_returncode = actual_result