Skip to content

Commit 49ed9c9

Browse files
authored
Merge pull request #536 from wkschwartz/patch-1
Fix incorrect and add missing annotations for loaddata command
2 parents 4829ce2 + d3ff541 commit 49ed9c9

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed
Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,35 @@
11
import zipfile
2-
from typing import Iterable, List, Optional, Tuple
2+
from typing import List, Optional, Set, Sequence, Tuple, Type
33

4+
from django.apps.config import AppConfig
45
from django.core.management.base import BaseCommand
6+
from django.db.models.base import Model
57

68
READ_STDIN: str = ...
79

810
class Command(BaseCommand):
11+
ignore: bool = ...
12+
using: str = ...
13+
app_label: str = ...
14+
verbosity: int = ...
15+
excluded_models: Set[Type[Model]] = ...
16+
excluded_apps: Set[AppConfig] = ...
17+
format: str = ...
918
missing_args_message: str = ...
10-
def loaddata(self, fixture_labels: Iterable[str]) -> None: ...
19+
def loaddata(self, fixture_labels: Sequence[str]) -> None: ...
1120
def load_label(self, fixture_label: str) -> None: ...
12-
def find_fixtures(self, fixture_label: str) -> List[Optional[str]]: ...
21+
def find_fixtures(self, fixture_label: str) -> List[Tuple[str, Optional[str], Optional[str]]]: ...
1322
@property
1423
def fixture_dirs(self) -> List[str]: ...
15-
def parse_name(self, fixture_name: str) -> Tuple[str, str, str]: ...
24+
def parse_name(self, fixture_name: str) -> Tuple[str, Optional[str], Optional[str]]: ...
1625

17-
class SingleZipReader(zipfile.ZipFile): ...
26+
class SingleZipReader(zipfile.ZipFile):
27+
# Incompatible override
28+
# zipfile.ZipFile.read(
29+
# self,
30+
# name: typing.Union[typing.Text, zipfile.ZipInfo],
31+
# pwd: Optional[bytes] = ...,
32+
# ) -> bytes: ...
33+
def read(self) -> bytes: ... # type: ignore[override]
1834

1935
def humanize(dirname: str) -> str: ...

0 commit comments

Comments
 (0)