From 40c8bfa510e9c7f6212f77fe509b04fcd02806a9 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 26 Oct 2020 11:43:47 +0300 Subject: [PATCH] Update migration.pyi (#501) * Update migration.pyi * Fixes tests * Fixes tests * Fixes tests --- .travis.yml | 2 +- dev-requirements.txt | 2 +- django-stubs/db/migrations/migration.pyi | 13 +++++++------ django-stubs/test/runner.pyi | 2 +- setup.py | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 59f487c..b9046ed 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ jobs: - name: Lint with black python: 3.7 - script: 'black --check django-stubs/' + script: 'black --check django-stubs/ setup.py' - name: Lint plugin code with flake8 python: 3.7 diff --git a/dev-requirements.txt b/dev-requirements.txt index 6353282..748a8ef 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,5 +1,5 @@ black -pytest-mypy-plugins==1.3.0 +pytest-mypy-plugins==1.6.1 psycopg2-binary flake8==3.7.9 flake8-pyi==19.3.0 diff --git a/django-stubs/db/migrations/migration.pyi b/django-stubs/db/migrations/migration.pyi index d13f494..093bc35 100644 --- a/django-stubs/db/migrations/migration.pyi +++ b/django-stubs/db/migrations/migration.pyi @@ -1,14 +1,15 @@ -from typing import Any, List, Tuple +from typing import Tuple, List, Optional from django.db.backends.base.schema import BaseDatabaseSchemaEditor from django.db.migrations.state import ProjectState +from django.db.migrations.operations.base import Operation class Migration: - operations: List[Any] = ... - dependencies: List[Any] = ... - run_before: List[Any] = ... - replaces: List[Any] = ... - initial: Any = ... + operations: List[Operation] = ... + dependencies: List[Tuple[str, str]] = ... + run_before: List[Tuple[str, str]] = ... + replaces: List[Tuple[str, str]] = ... + initial: Optional[bool] = ... atomic: bool = ... name: str = ... app_label: str = ... diff --git a/django-stubs/test/runner.pyi b/django-stubs/test/runner.pyi index 2d6042a..faecaab 100644 --- a/django-stubs/test/runner.pyi +++ b/django-stubs/test/runner.pyi @@ -70,7 +70,7 @@ class ParallelTestSuite(TestSuite): processes: Any = ... failfast: Any = ... def __init__(self, suite: Any, processes: Any, failfast: bool = ...) -> None: ... - def run(self, result: Any): ... + def run(self, result: Any): ... # type: ignore class DiscoverRunner: test_suite: Any = ... diff --git a/setup.py b/setup.py index ebb03ee..0e1c51d 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ with open("README.md", "r") as f: readme = f.read() dependencies = [ - "mypy>=0.782,<0.790", + "mypy>=0.790", "typing-extensions", "django", ]