Skip to content

Commit 676509a

Browse files
BlaackWizardpre-commit-ci[bot]sobolevn
authored
fix typing for get_auto_imports, get_namespace, and run_formatters (#2674)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: sobolevn <[email protected]>
1 parent 10f75b6 commit 676509a

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

django-stubs/core/management/commands/shell.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ class Command(BaseCommand):
99
def ipython(self, options: Any) -> None: ...
1010
def bpython(self, options: Any) -> None: ...
1111
def python(self, options: Any) -> None: ...
12+
def get_auto_imports(self) -> list[str]: ...
13+
def get_namespace(self, **options: Any) -> dict[str, Any]: ...

django-stubs/core/management/utils.pyi

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections.abc import Iterable, Sequence
22
from typing import Any
33

4-
from _typeshed import StrOrBytesPath, StrPath
4+
from _typeshed import StrOrBytesPath, StrPath, SupportsWrite
55
from django.apps.config import AppConfig
66
from django.db.models.base import Model
77

@@ -18,4 +18,6 @@ def get_command_line_option(argv: Sequence[Any], option: Any) -> Any | None: ...
1818
def normalize_path_patterns(patterns: Iterable[str]) -> list[str]: ...
1919
def is_ignored_path(path: StrPath, ignore_patterns: Iterable[str]) -> bool: ...
2020
def find_formatters() -> dict[str, str | None]: ...
21-
def run_formatters(written_files: Sequence[StrOrBytesPath], black_path: str = ...) -> None: ...
21+
def run_formatters(
22+
written_files: Iterable[StrOrBytesPath], black_path: str = ..., stderr: SupportsWrite[str] = ...
23+
) -> None: ...

scripts/stubtest/allowlist_todo_django52.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ django.core.checks.commands
4848
django.core.checks.registry.Tags.commands
4949
django.core.handlers.wsgi.LimitedStream.read
5050
django.core.handlers.wsgi.LimitedStream.readline
51-
django.core.management.commands.shell.Command.get_auto_imports
52-
django.core.management.commands.shell.Command.get_namespace
53-
django.core.management.utils.run_formatters
5451
django.db.backends.base.features.BaseDatabaseFeatures.rounds_to_even
5552
django.db.backends.base.features.BaseDatabaseFeatures.supports_tuple_lookups
5653
django.db.backends.base.schema.BaseDatabaseSchemaEditor.sql_pk_constraint

0 commit comments

Comments
 (0)