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

Add GeoModelAdminMixin #1982

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Add GeoModelAdminMixin #1982

wants to merge 10 commits into from

Conversation

q0w
Copy link
Contributor

@q0w q0w commented Feb 25, 2024

django-stubs/contrib/gis/admin/options.pyi Outdated Show resolved Hide resolved
django-stubs/contrib/gis/admin/options.pyi Outdated Show resolved Hide resolved
@q0w
Copy link
Contributor Author

q0w commented Feb 25, 2024

Should it be ignored?

error: django.contrib.gis.admin.options.GeoModelAdminMixin.gis_widget variable differs from runtime type django.forms.widgets.MediaDefiningClass
Stub: in file /home/runner/work/django-stubs/django-stubs/django-stubs/contrib/gis/admin/options.pyi:13
Type[django.contrib.gis.forms.widgets.OSMWidget]

@sobolevn
Copy link
Member

I propose to ignore it for now with a comment (in stubtest_allowlist.txt) and report it to mypy. This looks like a bug to me.

@q0w
Copy link
Contributor Author

q0w commented Feb 25, 2024

@sobolevn
Copy link
Member

@q0w you need stubtest, not mypy to reproduce it.

@q0w
Copy link
Contributor Author

q0w commented Feb 25, 2024

Oh, ok, its reproducible

@@ -394,3 +394,6 @@ django.urls.resolvers.URLPattern.lookup_str
django.urls.resolvers.URLResolver.url_patterns
django.urls.resolvers.URLResolver.urlconf_module
django.utils.connection.BaseConnectionHandler.settings

# Potential mypy bug with metaclass
django.contrib.gis.admin.options.GeoModelAdminMixin.gis_widget
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also might be a bug with our plugin. Can you please try with and without ClassVar?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In both cases it fails

scripts/stubtest/allowlist.txt Outdated Show resolved Hide resolved
@intgr
Copy link
Collaborator

intgr commented Mar 25, 2024

Assigned to @sobolevn. If you don't want to lead the review here, feel free to unassign yourself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants