Skip to content

Commit 3e973dc

Browse files
committed
Revert main.py and remove reproduction script as requested
1 parent 14f7bd3 commit 3e973dc

2 files changed

Lines changed: 13 additions & 15 deletions

File tree

mypy_django_plugin/main.py

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import itertools
55
import sys
66
from functools import cached_property, partial
7-
from typing import TYPE_CHECKING, Any, cast
7+
from typing import TYPE_CHECKING, Any
88

99
from mypy.build import PRI_MED, PRI_MYPY
1010
from mypy.modulefinder import mypy_path
@@ -326,18 +326,21 @@ def get_dynamic_class_hook(self, fullname: str) -> Callable[[DynamicClassDefCont
326326
if info and info.has_base(fullnames.BASE_MANAGER_CLASS_FULLNAME):
327327
return create_new_manager_class_from_from_queryset_method
328328
return None
329+
329330
@override
330331
def report_config_data(self, ctx: ReportConfigContext) -> dict[str, Any]:
331-
extra_data: dict[str, Any] = {
332-
"AUTH_USER_MODEL": self.django_context.settings.AUTH_USER_MODEL,
333-
"django_version": importlib.metadata.version("django"),
334-
"django_stubs_version": "5.1.0",
335-
}
332+
# Cache would be cleared if any settings do change.
333+
extra_data = {
334+
"AUTH_USER_MODEL": self.django_context.settings.AUTH_USER_MODEL,
335+
"django_version": importlib.metadata.version("django"),
336+
"django_stubs_version": importlib.metadata.version("django-stubs"),
337+
}
336338
try:
337-
extra_data["django_stubs_ext_version"] = "5.1.0"
338-
except Exception:
339+
extra_data["django_stubs_ext_version"] = importlib.metadata.version("django-stubs-ext")
340+
except importlib.metadata.PackageNotFoundError:
339341
pass
340-
341342
return self.plugin_config.to_json(extra_data)
343+
344+
342345
def plugin(version: str) -> type[NewSemanalDjangoPlugin]:
343-
return NewSemanalDjangoPlugin
346+
return NewSemanalDjangoPlugin

reproduce_issue.py

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)