From 87877774cdbc83a0c57796a64f0007915bee7127 Mon Sep 17 00:00:00 2001 From: Maxim Kurnikov Date: Sun, 20 Jan 2019 18:57:26 +0300 Subject: [PATCH] fix problems with 0.660 --- django-stubs/forms/forms.pyi | 2 -- django-stubs/test/runner.pyi | 1 - mypy_django_plugin/helpers.py | 2 +- scripts/typecheck_django_tests.xsh | 2 +- setup.py | 2 +- 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/django-stubs/forms/forms.pyi b/django-stubs/forms/forms.pyi index 1f86a0d..8a8723e 100644 --- a/django-stubs/forms/forms.pyi +++ b/django-stubs/forms/forms.pyi @@ -17,8 +17,6 @@ class DeclarativeFieldsMetaclass(MediaDefiningClass): def __new__( mcs: Type[DeclarativeFieldsMetaclass], name: str, bases: Tuple[Type[BaseForm]], attrs: OrderedDict ) -> Type[BaseForm]: ... - @classmethod - def __prepare__(metacls: Any, name: str, bases: Tuple[Type[BaseForm]], **kwds: Any) -> OrderedDict: ... class BaseForm: default_renderer: Any = ... diff --git a/django-stubs/test/runner.pyi b/django-stubs/test/runner.pyi index f391fb5..f63451e 100644 --- a/django-stubs/test/runner.pyi +++ b/django-stubs/test/runner.pyi @@ -28,7 +28,6 @@ class DebugSQLTextTestResult(TextTestResult): def stopTest(self, test: TestCase) -> None: ... def addError(self, test: Any, err: Any) -> None: ... def addFailure(self, test: Any, err: Any) -> None: ... - def printErrorList(self, flavour: str, errors: List[Tuple[TestCase, str, str]]) -> None: ... class RemoteTestResult: events: List[Any] = ... diff --git a/mypy_django_plugin/helpers.py b/mypy_django_plugin/helpers.py index 00cba52..f206148 100644 --- a/mypy_django_plugin/helpers.py +++ b/mypy_django_plugin/helpers.py @@ -1,7 +1,7 @@ import typing from typing import Dict, Optional -from mypy.nodes import StrExpr, MypyFile, TypeInfo, ImportedName, SymbolNode +from mypy.nodes import MypyFile, TypeInfo, ImportedName, SymbolNode MODEL_CLASS_FULLNAME = 'django.db.models.base.Model' FOREIGN_KEY_FULLNAME = 'django.db.models.fields.related.ForeignKey' diff --git a/scripts/typecheck_django_tests.xsh b/scripts/typecheck_django_tests.xsh index 504b114..fbcbfe8 100644 --- a/scripts/typecheck_django_tests.xsh +++ b/scripts/typecheck_django_tests.xsh @@ -3,7 +3,7 @@ if not os.path.exists('./django-sources'): git clone -b stable/2.1.x https://github.com/django/django.git django-sources ignored_error_patterns = ["Need type annotation for", "already defined on", "Cannot assign to a"] -for line in $(mypy --config-file ./scripts/mypy.ini ./django-sources/tests/files).split('\n'): +for line in $(mypy --config-file ./scripts/mypy.ini ./django-sources/tests).split('\n'): for pattern in ignored_error_patterns: if pattern in line: break diff --git a/setup.py b/setup.py index 0fea1d4..4c2e97c 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ setup( python_requires='>=3', install_requires=[ 'Django', - 'mypy @ git+https://github.com/python/mypy.git#egg=mypy-0.660+dev.a7296c4595350768ec8ecf145c23a76b6c98e8e6' + 'mypy' ], packages=['django-stubs', *find_packages()], package_data={'django-stubs': find_stub_files('django-stubs')},