Skip to content

Commit

Permalink
Use PRI_MYPY in get_additional_deps hook (#2024)
Browse files Browse the repository at this point in the history
This value comes from here: https://github.com/python/mypy/blob/394d17b758bae6c95cbe91b84c5cccf0f4d73c28/mypy/build.py#L382

It is more correct than `PRI_MED` that we used, because it is a typing-only import.
  • Loading branch information
sobolevn authored Mar 22, 2024
1 parent 673c832 commit e517a1f
Showing 1 changed file with 3 additions and 1 deletion.
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

0 comments on commit e517a1f

Please sign in to comment.