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

Remove unused DjangoContext creation #433

Merged
merged 1 commit into from
Jun 26, 2023
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
9 changes: 0 additions & 9 deletions mypy_drf_plugin/main.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
from typing import Callable, Dict, Optional, Type

from mypy.nodes import TypeInfo
from mypy.options import Options
from mypy.plugin import ClassDefContext, Plugin
from mypy_django_plugin.config import DjangoPluginConfig
from mypy_django_plugin.django.context import DjangoContext

from mypy_drf_plugin.lib import fullnames, helpers
from mypy_drf_plugin.transformers import serializers
Expand All @@ -19,12 +16,6 @@ def transform_serializer_class(ctx: ClassDefContext) -> None:


class NewSemanalDRFPlugin(Plugin):
def __init__(self, options: Options) -> None:
super().__init__(options)

django_settings_module = DjangoPluginConfig(options.config_file).django_settings_module
self.django_context = DjangoContext(django_settings_module)

def _get_currently_defined_serializers(self) -> Dict[str, int]:
base_serializer_sym = self.lookup_fully_qualified(fullnames.BASE_SERIALIZER_FULLNAME)
if base_serializer_sym is not None and isinstance(base_serializer_sym.node, TypeInfo):
Expand Down