Skip to content

Commit 40c8bfa

Browse files
authored
Update migration.pyi (#501)
* Update migration.pyi * Fixes tests * Fixes tests * Fixes tests
1 parent 402b7d5 commit 40c8bfa

File tree

5 files changed

+11
-10
lines changed

5 files changed

+11
-10
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Lint with black
4040
python: 3.7
41-
script: 'black --check django-stubs/'
41+
script: 'black --check django-stubs/ setup.py'
4242

4343
- name: Lint plugin code with flake8
4444
python: 3.7

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
black
2-
pytest-mypy-plugins==1.3.0
2+
pytest-mypy-plugins==1.6.1
33
psycopg2-binary
44
flake8==3.7.9
55
flake8-pyi==19.3.0

django-stubs/db/migrations/migration.pyi

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1-
from typing import Any, List, Tuple
1+
from typing import Tuple, List, Optional
22

33
from django.db.backends.base.schema import BaseDatabaseSchemaEditor
44
from django.db.migrations.state import ProjectState
5+
from django.db.migrations.operations.base import Operation
56

67
class Migration:
7-
operations: List[Any] = ...
8-
dependencies: List[Any] = ...
9-
run_before: List[Any] = ...
10-
replaces: List[Any] = ...
11-
initial: Any = ...
8+
operations: List[Operation] = ...
9+
dependencies: List[Tuple[str, str]] = ...
10+
run_before: List[Tuple[str, str]] = ...
11+
replaces: List[Tuple[str, str]] = ...
12+
initial: Optional[bool] = ...
1213
atomic: bool = ...
1314
name: str = ...
1415
app_label: str = ...

django-stubs/test/runner.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class ParallelTestSuite(TestSuite):
7070
processes: Any = ...
7171
failfast: Any = ...
7272
def __init__(self, suite: Any, processes: Any, failfast: bool = ...) -> None: ...
73-
def run(self, result: Any): ...
73+
def run(self, result: Any): ... # type: ignore
7474

7575
class DiscoverRunner:
7676
test_suite: Any = ...

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def find_stub_files(name: str) -> List[str]:
2121
readme = f.read()
2222

2323
dependencies = [
24-
"mypy>=0.782,<0.790",
24+
"mypy>=0.790",
2525
"typing-extensions",
2626
"django",
2727
]

0 commit comments

Comments
 (0)