Merge pull request #5022 from cookiecutter/pyup-update-mypy-1.7.1-to-1.10.0

Update mypy to 1.10.0
This commit is contained in:
Bruno Alla 2024-05-13 22:18:36 +01:00 committed by GitHub
commit 4710101acd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 6 additions and 6 deletions

View File

@ -13,12 +13,12 @@ watchfiles==0.21.0 # https://github.com/samuelcolvin/watchfiles
# Testing # Testing
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
mypy==1.7.1 # https://github.com/python/mypy mypy==1.10.0 # https://github.com/python/mypy
django-stubs[compatible-mypy]==4.2.7 # https://github.com/typeddjango/django-stubs django-stubs[compatible-mypy]==5.0.0 # https://github.com/typeddjango/django-stubs
pytest==8.2.0 # https://github.com/pytest-dev/pytest pytest==8.2.0 # https://github.com/pytest-dev/pytest
pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar pytest-sugar==1.0.0 # https://github.com/Frozenball/pytest-sugar
{%- if cookiecutter.use_drf == "y" %} {%- if cookiecutter.use_drf == "y" %}
djangorestframework-stubs[compatible-mypy]==3.14.5 # https://github.com/typeddjango/djangorestframework-stubs djangorestframework-stubs[compatible-mypy]==3.15.0 # https://github.com/typeddjango/djangorestframework-stubs
{%- endif %} {%- endif %}
# Documentation # Documentation

View File

@ -10,7 +10,7 @@ from .models import User
class UserAdminChangeForm(admin_forms.UserChangeForm): class UserAdminChangeForm(admin_forms.UserChangeForm):
class Meta(admin_forms.UserChangeForm.Meta): class Meta(admin_forms.UserChangeForm.Meta): # type: ignore[name-defined]
model = User model = User
{%- if cookiecutter.username_type == "email" %} {%- if cookiecutter.username_type == "email" %}
field_classes = {"email": EmailField} field_classes = {"email": EmailField}
@ -23,7 +23,7 @@ class UserAdminCreationForm(admin_forms.UserCreationForm):
To change user signup, see UserSignupForm and UserSocialSignupForm. To change user signup, see UserSignupForm and UserSocialSignupForm.
""" """
class Meta(admin_forms.UserCreationForm.Meta): class Meta(admin_forms.UserCreationForm.Meta): # type: ignore[name-defined]
model = User model = User
{%- if cookiecutter.username_type == "email" %} {%- if cookiecutter.username_type == "email" %}
fields = ("email",) fields = ("email",)

View File

@ -62,7 +62,7 @@ class TestUserAdmin:
# Reload the admin module to apply the setting change # Reload the admin module to apply the setting change
import {{ cookiecutter.project_slug }}.users.admin as users_admin import {{ cookiecutter.project_slug }}.users.admin as users_admin
with contextlib.suppress(admin.sites.AlreadyRegistered): with contextlib.suppress(admin.sites.AlreadyRegistered): # type: ignore[attr-defined]
reload(users_admin) reload(users_admin)
@pytest.mark.django_db() @pytest.mark.django_db()