mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-09 05:24:53 +08:00
add missing plugin entrypoint, add plugins.ini mypy config with plugins specified
This commit is contained in:
@@ -9,3 +9,7 @@ class PostgresFieldsPlugin(Plugin):
|
|||||||
def get_base_class_hook(self, fullname: str
|
def get_base_class_hook(self, fullname: str
|
||||||
):
|
):
|
||||||
return determine_type_of_array_field
|
return determine_type_of_array_field
|
||||||
|
|
||||||
|
|
||||||
|
def plugin(version):
|
||||||
|
return PostgresFieldsPlugin
|
||||||
|
|||||||
2
test/plugins.ini
Normal file
2
test/plugins.ini
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
[mypy]
|
||||||
|
plugins = mypy_django_plugin.plugins.postgres_fields
|
||||||
@@ -9,6 +9,7 @@ from mypy.test.helpers import assert_string_arrays_equal
|
|||||||
|
|
||||||
ROOT_DIR = Path(__file__).parent.parent
|
ROOT_DIR = Path(__file__).parent.parent
|
||||||
TEST_DATA_DIR = ROOT_DIR / 'test' / 'test-data'
|
TEST_DATA_DIR = ROOT_DIR / 'test' / 'test-data'
|
||||||
|
MYPY_INI_PATH = ROOT_DIR / 'test' / 'plugins.ini'
|
||||||
|
|
||||||
|
|
||||||
class DjangoTestSuite(DataSuite):
|
class DjangoTestSuite(DataSuite):
|
||||||
@@ -23,7 +24,8 @@ class DjangoTestSuite(DataSuite):
|
|||||||
|
|
||||||
mypy_cmdline = [
|
mypy_cmdline = [
|
||||||
'--show-traceback',
|
'--show-traceback',
|
||||||
'--no-silence-site-packages'
|
'--no-silence-site-packages',
|
||||||
|
'--config-file={}'.format(MYPY_INI_PATH)
|
||||||
]
|
]
|
||||||
mypy_cmdline.append('--python-version={}'.format('.'.join(map(str,
|
mypy_cmdline.append('--python-version={}'.format('.'.join(map(str,
|
||||||
sys.version_info[:2]))))
|
sys.version_info[:2]))))
|
||||||
|
|||||||
Reference in New Issue
Block a user