Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PRI_MYPY in get_additional_deps hook #2024

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mypy_django_plugin/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from functools import partial
from typing import Any, Callable, Dict, List, Optional, Tuple, Type

from mypy.build import PRI_MYPY
from mypy.modulefinder import mypy_path
from mypy.nodes import MypyFile, TypeInfo
from mypy.options import Options
Expand Down Expand Up @@ -99,7 +100,8 @@ def _get_typeinfo_or_none(self, class_name: str) -> Optional[TypeInfo]:
return None

def _new_dependency(self, module: str) -> Tuple[int, str, int]:
return 10, module, -1
fake_lineno = -1
return (PRI_MYPY, module, fake_lineno)

def get_additional_deps(self, file: MypyFile) -> List[Tuple[int, str, int]]:
# for settings
Expand Down
Loading