mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
7566e6549e
commit
acd7353538
@@ -49,4 +49,4 @@ API_FEATURE_LEVEL = 381
|
||||
# historical commits sharing the same major version, in which case a
|
||||
# minor version bump suffices.
|
||||
|
||||
PROVISION_VERSION = (325, 3) # bumped 2025-05-04 to upgrade uv
|
||||
PROVISION_VERSION = (326, 0) # bumped 2025-05-04 to upgrade Python requirements
|
||||
|
@@ -2,7 +2,7 @@ import base64
|
||||
import logging
|
||||
import re
|
||||
from email.headerregistry import Address
|
||||
from typing import Any
|
||||
from typing import TYPE_CHECKING, Any, TypeAlias
|
||||
|
||||
import dns.resolver
|
||||
import orjson
|
||||
@@ -426,7 +426,16 @@ class CaptchaRealmCreationForm(RealmCreationForm):
|
||||
return payload
|
||||
|
||||
|
||||
class LoggingSetPasswordForm(SetPasswordForm):
|
||||
# https://github.com/typeddjango/django-stubs/pull/2384#pullrequestreview-2813849209
|
||||
if TYPE_CHECKING:
|
||||
BaseSetPasswordForm: TypeAlias = SetPasswordForm[UserProfile] # type: ignore[type-var] # we don't subclass AbstractUser
|
||||
else:
|
||||
BaseSetPasswordForm = SetPasswordForm
|
||||
|
||||
|
||||
class LoggingSetPasswordForm(
|
||||
BaseSetPasswordForm # type: ignore[type-var] # we don't subclass AbstractUser
|
||||
):
|
||||
new_password1 = forms.CharField(
|
||||
label=_("New password"),
|
||||
widget=forms.PasswordInput(attrs={"autocomplete": "new-password"}),
|
||||
@@ -452,7 +461,6 @@ class LoggingSetPasswordForm(SetPasswordForm):
|
||||
|
||||
@override
|
||||
def save(self, commit: bool = True) -> UserProfile:
|
||||
assert isinstance(self.user, UserProfile)
|
||||
do_change_password(self.user, self.cleaned_data["new_password1"], commit=commit)
|
||||
return self.user
|
||||
|
||||
|
@@ -330,11 +330,13 @@ Output:
|
||||
self,
|
||||
url: str,
|
||||
info: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
intentionally_undocumented: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
"""
|
||||
@@ -350,6 +352,7 @@ Output:
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
intentionally_undocumented=intentionally_undocumented,
|
||||
**extra,
|
||||
)
|
||||
@@ -359,10 +362,12 @@ Output:
|
||||
self,
|
||||
url: str,
|
||||
info: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
intentionally_undocumented: bool = False,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
@@ -384,6 +389,7 @@ Output:
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
intentionally_undocumented=intentionally_undocumented,
|
||||
**extra,
|
||||
)
|
||||
@@ -392,9 +398,12 @@ Output:
|
||||
self,
|
||||
url: str,
|
||||
payload: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
data = orjson.dumps(payload)
|
||||
@@ -406,7 +415,8 @@ Output:
|
||||
content_type="application/json",
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=None,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
**extra,
|
||||
)
|
||||
|
||||
@@ -415,10 +425,12 @@ Output:
|
||||
self,
|
||||
url: str,
|
||||
info: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
encoded = urlencode(info)
|
||||
@@ -426,17 +438,25 @@ Output:
|
||||
django_client = self.client # see WRAPPER_COMMENT
|
||||
self.set_http_headers(extra, skip_user_agent)
|
||||
return django_client.put(
|
||||
url, encoded, follow=follow, secure=secure, headers=headers, **extra
|
||||
url,
|
||||
encoded,
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
**extra,
|
||||
)
|
||||
|
||||
def json_put(
|
||||
self,
|
||||
url: str,
|
||||
payload: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
data = orjson.dumps(payload)
|
||||
@@ -449,6 +469,7 @@ Output:
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
**extra,
|
||||
)
|
||||
|
||||
@@ -457,10 +478,12 @@ Output:
|
||||
self,
|
||||
url: str,
|
||||
info: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
intentionally_undocumented: bool = False,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
@@ -477,6 +500,7 @@ Output:
|
||||
"Content-Type": "application/x-www-form-urlencoded", # https://code.djangoproject.com/ticket/33230
|
||||
**(headers or {}),
|
||||
},
|
||||
query_params=query_params,
|
||||
intentionally_undocumented=intentionally_undocumented,
|
||||
**extra,
|
||||
)
|
||||
@@ -486,16 +510,24 @@ Output:
|
||||
self,
|
||||
url: str,
|
||||
info: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
django_client = self.client # see WRAPPER_COMMENT
|
||||
self.set_http_headers(extra, skip_user_agent)
|
||||
return django_client.options(
|
||||
url, dict(info), follow=follow, secure=secure, headers=headers, **extra
|
||||
url,
|
||||
dict(info),
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
**extra,
|
||||
)
|
||||
|
||||
@instrument_url
|
||||
@@ -503,25 +535,37 @@ Output:
|
||||
self,
|
||||
url: str,
|
||||
info: Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
django_client = self.client # see WRAPPER_COMMENT
|
||||
self.set_http_headers(extra, skip_user_agent)
|
||||
return django_client.head(url, info, follow=follow, secure=secure, headers=headers, **extra)
|
||||
return django_client.head(
|
||||
url,
|
||||
info,
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
**extra,
|
||||
)
|
||||
|
||||
@instrument_url
|
||||
def client_post(
|
||||
self,
|
||||
url: str,
|
||||
info: str | bytes | Mapping[str, Any] = {},
|
||||
*,
|
||||
skip_user_agent: bool = False,
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
intentionally_undocumented: bool = False,
|
||||
content_type: str | None = None,
|
||||
**extra: str,
|
||||
@@ -549,6 +593,7 @@ Output:
|
||||
"Content-Type": content_type, # https://code.djangoproject.com/ticket/33230
|
||||
**(headers or {}),
|
||||
},
|
||||
query_params=query_params,
|
||||
content_type=content_type,
|
||||
intentionally_undocumented=intentionally_undocumented,
|
||||
**extra,
|
||||
@@ -577,6 +622,7 @@ Output:
|
||||
follow: bool = False,
|
||||
secure: bool = False,
|
||||
headers: Mapping[str, Any] | None = None,
|
||||
query_params: Mapping[str, Any] | None = None,
|
||||
intentionally_undocumented: bool = False,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
@@ -588,6 +634,7 @@ Output:
|
||||
follow=follow,
|
||||
secure=secure,
|
||||
headers=headers,
|
||||
query_params=query_params,
|
||||
intentionally_undocumented=intentionally_undocumented,
|
||||
**extra,
|
||||
)
|
||||
@@ -741,6 +788,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
@@ -884,6 +932,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
@@ -990,6 +1039,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
@@ -1009,6 +1059,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
@@ -1024,6 +1075,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
@@ -1033,6 +1085,7 @@ Output:
|
||||
user: UserProfile,
|
||||
url: str,
|
||||
info: str | bytes | Mapping[str, Any] = {},
|
||||
*,
|
||||
intentionally_undocumented: bool = False,
|
||||
**extra: str,
|
||||
) -> "TestHttpResponse":
|
||||
@@ -1044,6 +1097,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=intentionally_undocumented,
|
||||
**extra,
|
||||
)
|
||||
@@ -1059,6 +1113,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
@@ -1074,6 +1129,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
@@ -1578,6 +1634,7 @@ Output:
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
intentionally_undocumented=False,
|
||||
**extra,
|
||||
)
|
||||
|
@@ -6,4 +6,4 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0042_attachment_file_name_length"),
|
||||
]
|
||||
|
||||
operations: list[migrations.operations.base.Operation] = []
|
||||
operations = []
|
||||
|
@@ -9,4 +9,4 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0093_subscription_event_log_backfill"),
|
||||
]
|
||||
|
||||
operations: list[migrations.operations.base.Operation] = []
|
||||
operations = []
|
||||
|
@@ -1,5 +1,3 @@
|
||||
from typing import Any
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@@ -8,7 +6,7 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0126_prereg_remove_users_without_realm"),
|
||||
]
|
||||
|
||||
operations: list[Any] = [
|
||||
operations = [
|
||||
# There was a migration here, which wasn't ready for wide deployment
|
||||
# and was backed out. This placeholder is left behind to avoid
|
||||
# confusing the migration engine on any installs that applied the
|
||||
|
@@ -1,7 +1,5 @@
|
||||
# Generated by Django 1.11.26 on 2019-11-21 01:47
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@@ -11,4 +9,4 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0209_user_profile_no_empty_password"),
|
||||
]
|
||||
|
||||
operations: list[Any] = []
|
||||
operations = []
|
||||
|
@@ -1,7 +1,5 @@
|
||||
# Generated by Django 2.2.13 on 2020-06-17 06:26
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@@ -11,4 +9,4 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0285_remove_realm_google_hangouts_domain"),
|
||||
]
|
||||
|
||||
operations: list[Any] = []
|
||||
operations = []
|
||||
|
@@ -13,4 +13,4 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0309_userprofile_can_create_users"),
|
||||
]
|
||||
|
||||
operations: list[migrations.operations.base.Operation] = []
|
||||
operations = []
|
||||
|
@@ -1,7 +1,5 @@
|
||||
# Generated by Django 3.2.7 on 2021-10-04 17:49
|
||||
|
||||
from typing import Any
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@@ -11,4 +9,4 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0359_re2_linkifiers"),
|
||||
]
|
||||
|
||||
operations: list[Any] = []
|
||||
operations = []
|
||||
|
@@ -1,6 +1,5 @@
|
||||
# Generated by Django 3.2.8 on 2021-10-20 23:42
|
||||
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
@@ -9,4 +8,4 @@ class Migration(migrations.Migration):
|
||||
("zerver", "0367_scimclient"),
|
||||
]
|
||||
|
||||
operations: list[migrations.operations.base.Operation] = []
|
||||
operations = []
|
||||
|
@@ -64,6 +64,7 @@ def send_webhook_fixture_message(
|
||||
follow=False,
|
||||
secure=False,
|
||||
headers=None,
|
||||
query_params=None,
|
||||
HTTP_HOST=http_host,
|
||||
**standardized_headers,
|
||||
)
|
||||
|
Reference in New Issue
Block a user