Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add support for mypy plugins to enable django-stubs testing in typeshed library#1990

huynguyengl99 started this conversation inGeneral
Discussion options

We can support Django type checking via mypy's django-stubs plugin. The required mypy.ini configuration is simply:

[mypy]plugins = mypy_django_plugin.main[mypy.plugins.django-stubs]django_settings_module = scripts.tests_settings

With a minimal tests_settings.py file:

SECRET_KEY="1"INSTALLED_APPS= ("django.contrib.contenttypes","django.contrib.sites","django.contrib.sessions","django.contrib.messages","django.contrib.admin.apps.SimpleAdminConfig","django.contrib.staticfiles","django.contrib.auth","channels",)

I propose we extend our typing tools to support mypy plugins by adding the "plugins" field to the KNOWN_METADATA_TOOL_FIELDS dictionary:

KNOWN_METADATA_TOOL_FIELDS:Final= {"stubtest": {"skip","apt_dependencies","brew_dependencies","choco_dependencies","extras","ignore_missing_stub","platforms","stubtest_requirements",    },"mypy": {"plugins",    }}

This would allow package maintainers to specify in their METADATA.toml:

[tool.mypy]plugins ="mypy_django_plugin.main"[tool.mypy.plugins.django-stubs]django_settings_module ="scripts.tests_settings"

This enhancement would enable proper stubtest functionality for Django-based stubs libraries. What do you think about this idea?

You must be logged in to vote

Replies: 1 comment

Comment options

I will be happy to help fromdjango-stubs side :)

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@huynguyengl99@sobolevn

[8]ページ先頭

©2009-2025 Movatter.jp