Skip to content

Conversation

q0w
Copy link
Contributor

@q0w q0w commented Feb 25, 2024

@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

@q0w q0w force-pushed the GeoModelAdminMixin branch from e9c0ded to dcfa42e Compare February 25, 2024 16:17
@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.

3 participants