diff --git a/mypy_django_plugin_newsemanal/__init__.py b/mypy_django_plugin/__init__.py similarity index 100% rename from mypy_django_plugin_newsemanal/__init__.py rename to mypy_django_plugin/__init__.py diff --git a/mypy_django_plugin_newsemanal/django/__init__.py b/mypy_django_plugin/django/__init__.py similarity index 100% rename from mypy_django_plugin_newsemanal/django/__init__.py rename to mypy_django_plugin/django/__init__.py diff --git a/mypy_django_plugin_newsemanal/django/context.py b/mypy_django_plugin/django/context.py similarity index 99% rename from mypy_django_plugin_newsemanal/django/context.py rename to mypy_django_plugin/django/context.py index 802bd2b..c585558 100644 --- a/mypy_django_plugin_newsemanal/django/context.py +++ b/mypy_django_plugin/django/context.py @@ -16,7 +16,7 @@ from django.db.models.fields import CharField, Field from django.db.models.fields.reverse_related import ForeignObjectRel from django.db.models.sql.query import Query -from mypy_django_plugin_newsemanal.lib import helpers +from mypy_django_plugin.lib import helpers if TYPE_CHECKING: from django.apps.registry import Apps diff --git a/mypy_django_plugin_newsemanal/lib/__init__.py b/mypy_django_plugin/lib/__init__.py similarity index 100% rename from mypy_django_plugin_newsemanal/lib/__init__.py rename to mypy_django_plugin/lib/__init__.py diff --git a/mypy_django_plugin_newsemanal/lib/fullnames.py b/mypy_django_plugin/lib/fullnames.py similarity index 100% rename from mypy_django_plugin_newsemanal/lib/fullnames.py rename to mypy_django_plugin/lib/fullnames.py diff --git a/mypy_django_plugin_newsemanal/lib/helpers.py b/mypy_django_plugin/lib/helpers.py similarity index 100% rename from mypy_django_plugin_newsemanal/lib/helpers.py rename to mypy_django_plugin/lib/helpers.py diff --git a/mypy_django_plugin_newsemanal/main.py b/mypy_django_plugin/main.py similarity index 96% rename from mypy_django_plugin_newsemanal/main.py rename to mypy_django_plugin/main.py index d2a6cc7..3c9769e 100644 --- a/mypy_django_plugin_newsemanal/main.py +++ b/mypy_django_plugin/main.py @@ -9,10 +9,10 @@ from mypy.options import Options from mypy.plugin import AttributeContext, ClassDefContext, FunctionContext, MethodContext, Plugin from mypy.types import Type as MypyType -from mypy_django_plugin_newsemanal.django.context import DjangoContext -from mypy_django_plugin_newsemanal.lib import fullnames, helpers -from mypy_django_plugin_newsemanal.transformers import fields, forms, init_create, querysets, settings -from mypy_django_plugin_newsemanal.transformers.models import process_model_class +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers +from mypy_django_plugin.transformers import fields, forms, init_create, querysets, settings +from mypy_django_plugin.transformers.models import process_model_class def transform_model_class(ctx: ClassDefContext, diff --git a/mypy_django_plugin_newsemanal/transformers/__init__.py b/mypy_django_plugin/transformers/__init__.py similarity index 100% rename from mypy_django_plugin_newsemanal/transformers/__init__.py rename to mypy_django_plugin/transformers/__init__.py diff --git a/mypy_django_plugin_newsemanal/transformers/fields.py b/mypy_django_plugin/transformers/fields.py similarity index 98% rename from mypy_django_plugin_newsemanal/transformers/fields.py rename to mypy_django_plugin/transformers/fields.py index 6c5a390..0467f3f 100644 --- a/mypy_django_plugin_newsemanal/transformers/fields.py +++ b/mypy_django_plugin/transformers/fields.py @@ -5,8 +5,8 @@ from mypy.nodes import StrExpr, TypeInfo from mypy.plugin import FunctionContext from mypy.types import AnyType, CallableType, Instance, Type as MypyType, UnionType -from mypy_django_plugin_newsemanal.django.context import DjangoContext -from mypy_django_plugin_newsemanal.lib import fullnames, helpers +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers def extract_referred_to_type(ctx: FunctionContext, django_context: DjangoContext) -> Optional[Instance]: diff --git a/mypy_django_plugin_newsemanal/transformers/forms.py b/mypy_django_plugin/transformers/forms.py similarity index 100% rename from mypy_django_plugin_newsemanal/transformers/forms.py rename to mypy_django_plugin/transformers/forms.py diff --git a/mypy_django_plugin_newsemanal/transformers/init_create.py b/mypy_django_plugin/transformers/init_create.py similarity index 97% rename from mypy_django_plugin_newsemanal/transformers/init_create.py rename to mypy_django_plugin/transformers/init_create.py index f83f05c..83bfa2a 100644 --- a/mypy_django_plugin_newsemanal/transformers/init_create.py +++ b/mypy_django_plugin/transformers/init_create.py @@ -4,7 +4,7 @@ from django.db.models.base import Model from mypy.plugin import FunctionContext, MethodContext from mypy.types import Instance, Type as MypyType -from mypy_django_plugin_newsemanal.django.context import DjangoContext +from mypy_django_plugin.django.context import DjangoContext def get_actual_types(ctx: Union[MethodContext, FunctionContext], expected_keys: List[str]) -> List[Tuple[str, MypyType]]: diff --git a/mypy_django_plugin_newsemanal/transformers/models.py b/mypy_django_plugin/transformers/models.py similarity index 96% rename from mypy_django_plugin_newsemanal/transformers/models.py rename to mypy_django_plugin/transformers/models.py index e13104b..61579f2 100644 --- a/mypy_django_plugin_newsemanal/transformers/models.py +++ b/mypy_django_plugin/transformers/models.py @@ -9,10 +9,10 @@ from mypy.nodes import ClassDef, MDEF, SymbolTableNode, TypeInfo, Var from mypy.plugin import ClassDefContext from mypy.types import Instance -from mypy_django_plugin_newsemanal.django.context import DjangoContext -from mypy_django_plugin_newsemanal.lib import fullnames, helpers -from mypy_django_plugin_newsemanal.transformers import fields -from mypy_django_plugin_newsemanal.transformers.fields import get_field_descriptor_types +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers +from mypy_django_plugin.transformers import fields +from mypy_django_plugin.transformers.fields import get_field_descriptor_types @dataclasses.dataclass diff --git a/mypy_django_plugin_newsemanal/transformers/querysets.py b/mypy_django_plugin/transformers/querysets.py similarity index 98% rename from mypy_django_plugin_newsemanal/transformers/querysets.py rename to mypy_django_plugin/transformers/querysets.py index 22dfb82..e0d8abd 100644 --- a/mypy_django_plugin_newsemanal/transformers/querysets.py +++ b/mypy_django_plugin/transformers/querysets.py @@ -8,8 +8,8 @@ from mypy.nodes import NameExpr from mypy.plugin import AnalyzeTypeContext, FunctionContext, MethodContext from mypy.types import AnyType, Instance, Type as MypyType, TypeOfAny -from mypy_django_plugin_newsemanal.django.context import DjangoContext -from mypy_django_plugin_newsemanal.lib import fullnames, helpers +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import fullnames, helpers def set_first_generic_param_as_default_for_second(ctx: AnalyzeTypeContext, fullname: str) -> MypyType: diff --git a/mypy_django_plugin_newsemanal/transformers/settings.py b/mypy_django_plugin/transformers/settings.py similarity index 93% rename from mypy_django_plugin_newsemanal/transformers/settings.py rename to mypy_django_plugin/transformers/settings.py index dc3458c..0a0689e 100644 --- a/mypy_django_plugin_newsemanal/transformers/settings.py +++ b/mypy_django_plugin/transformers/settings.py @@ -2,8 +2,8 @@ from mypy.nodes import TypeInfo, MemberExpr from mypy.plugin import FunctionContext, AttributeContext from mypy.types import Type as MypyType, TypeType, Instance -from mypy_django_plugin_newsemanal.django.context import DjangoContext -from mypy_django_plugin_newsemanal.lib import helpers +from mypy_django_plugin.django.context import DjangoContext +from mypy_django_plugin.lib import helpers def get_user_model_hook(ctx: FunctionContext, django_context: DjangoContext) -> MypyType: diff --git a/pytest.ini b/pytest.ini index ff7d9fd..fe0dff4 100644 --- a/pytest.ini +++ b/pytest.ini @@ -1,8 +1,8 @@ [pytest] -testpaths = ./test-data-newsemanal +testpaths = ./test-data addopts = --tb=native - --mypy-ini-file=./test-data-newsemanal/plugins.ini + --mypy-ini-file=./test-data/plugins.ini -s -v --cache-clear \ No newline at end of file diff --git a/setup.py b/setup.py index 6157ae4..0f039eb 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,8 @@ with open('README.md', 'r') as f: dependencies = [ 'mypy>=0.720,<0.730', - 'typing-extensions' + 'typing-extensions', + 'toml' ] if sys.version_info[:2] < (3, 7): # dataclasses port for 3.6 diff --git a/test-data-newsemanal/plugins.ini b/test-data/plugins.ini similarity index 60% rename from test-data-newsemanal/plugins.ini rename to test-data/plugins.ini index 401fb91..b7b510b 100644 --- a/test-data-newsemanal/plugins.ini +++ b/test-data/plugins.ini @@ -2,4 +2,4 @@ incremental = True strict_optional = True plugins = - mypy_django_plugin_newsemanal.main + mypy_django_plugin.main diff --git a/test-data-newsemanal/typecheck/fields/test_base.yml b/test-data/typecheck/fields/test_base.yml similarity index 100% rename from test-data-newsemanal/typecheck/fields/test_base.yml rename to test-data/typecheck/fields/test_base.yml diff --git a/test-data-newsemanal/typecheck/fields/test_nullable.yml b/test-data/typecheck/fields/test_nullable.yml similarity index 100% rename from test-data-newsemanal/typecheck/fields/test_nullable.yml rename to test-data/typecheck/fields/test_nullable.yml diff --git a/test-data-newsemanal/typecheck/fields/test_postgres_fields.yml b/test-data/typecheck/fields/test_postgres_fields.yml similarity index 100% rename from test-data-newsemanal/typecheck/fields/test_postgres_fields.yml rename to test-data/typecheck/fields/test_postgres_fields.yml diff --git a/test-data-newsemanal/typecheck/fields/test_related.yml b/test-data/typecheck/fields/test_related.yml similarity index 100% rename from test-data-newsemanal/typecheck/fields/test_related.yml rename to test-data/typecheck/fields/test_related.yml diff --git a/test-data-newsemanal/typecheck/managers/querysets/test_basic_methods.yml b/test-data/typecheck/managers/querysets/test_basic_methods.yml similarity index 100% rename from test-data-newsemanal/typecheck/managers/querysets/test_basic_methods.yml rename to test-data/typecheck/managers/querysets/test_basic_methods.yml diff --git a/test-data-newsemanal/typecheck/managers/querysets/test_values.yml b/test-data/typecheck/managers/querysets/test_values.yml similarity index 100% rename from test-data-newsemanal/typecheck/managers/querysets/test_values.yml rename to test-data/typecheck/managers/querysets/test_values.yml diff --git a/test-data-newsemanal/typecheck/managers/querysets/test_values_list.yml b/test-data/typecheck/managers/querysets/test_values_list.yml similarity index 100% rename from test-data-newsemanal/typecheck/managers/querysets/test_values_list.yml rename to test-data/typecheck/managers/querysets/test_values_list.yml diff --git a/test-data-newsemanal/typecheck/managers/test_managers.yml b/test-data/typecheck/managers/test_managers.yml similarity index 100% rename from test-data-newsemanal/typecheck/managers/test_managers.yml rename to test-data/typecheck/managers/test_managers.yml diff --git a/test-data-newsemanal/typecheck/models/test_create.yml b/test-data/typecheck/models/test_create.yml similarity index 100% rename from test-data-newsemanal/typecheck/models/test_create.yml rename to test-data/typecheck/models/test_create.yml diff --git a/test-data-newsemanal/typecheck/models/test_inheritance.yml b/test-data/typecheck/models/test_inheritance.yml similarity index 100% rename from test-data-newsemanal/typecheck/models/test_inheritance.yml rename to test-data/typecheck/models/test_inheritance.yml diff --git a/test-data-newsemanal/typecheck/models/test_init.yml b/test-data/typecheck/models/test_init.yml similarity index 100% rename from test-data-newsemanal/typecheck/models/test_init.yml rename to test-data/typecheck/models/test_init.yml diff --git a/test-data-newsemanal/typecheck/test_config.yml b/test-data/typecheck/test_config.yml similarity index 100% rename from test-data-newsemanal/typecheck/test_config.yml rename to test-data/typecheck/test_config.yml diff --git a/test-data-newsemanal/typecheck/test_forms.yml b/test-data/typecheck/test_forms.yml similarity index 100% rename from test-data-newsemanal/typecheck/test_forms.yml rename to test-data/typecheck/test_forms.yml diff --git a/test-data-newsemanal/typecheck/test_helpers.yml b/test-data/typecheck/test_helpers.yml similarity index 100% rename from test-data-newsemanal/typecheck/test_helpers.yml rename to test-data/typecheck/test_helpers.yml diff --git a/test-data-newsemanal/typecheck/test_import_all.yml b/test-data/typecheck/test_import_all.yml similarity index 100% rename from test-data-newsemanal/typecheck/test_import_all.yml rename to test-data/typecheck/test_import_all.yml diff --git a/test-data-newsemanal/typecheck/test_settings.yml b/test-data/typecheck/test_settings.yml similarity index 100% rename from test-data-newsemanal/typecheck/test_settings.yml rename to test-data/typecheck/test_settings.yml diff --git a/test-data-newsemanal/typecheck/test_shortcuts.yml b/test-data/typecheck/test_shortcuts.yml similarity index 100% rename from test-data-newsemanal/typecheck/test_shortcuts.yml rename to test-data/typecheck/test_shortcuts.yml