Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
python: Add missing TypeAlias annotations.
Anders Kaseorgae47de36c9af
diff --git a/confirmation/models.py b/confirmation/models.pyindex 5409e7637f0..fdb343f8e4f 100644--- a/confirmation/models.py+++ b/confirmation/models.py@@ -76,7 +76,7 @@ ZilencerConfirmationObjT: TypeAlias = Union["PreregistrationRemoteRealmBillingUser",]-ConfirmationObjT = Union[NoZilencerConfirmationObjT, ZilencerConfirmationObjT]+ConfirmationObjT: TypeAlias = Union[NoZilencerConfirmationObjT, ZilencerConfirmationObjT]def get_object_from_key(diff --git a/corporate/views/remote_billing_page.py b/corporate/views/remote_billing_page.pyindex 124c70fd671..41bda0279b2 100644--- a/corporate/views/remote_billing_page.py+++ b/corporate/views/remote_billing_page.py@@ -15,6 +15,7 @@ from django.utils.translation import get_languagefrom django.utils.translation import gettext as _from django.views.decorators.csrf import csrf_exemptfrom pydantic import Json+from typing_extensions import TypeAliasfrom confirmation.models import (Confirmation,@@ -71,7 +72,9 @@ billing_logger = logging.getLogger("corporate.stripe")VALID_NEXT_PAGES = [None, "sponsorship", "upgrade", "billing", "plans", "deactivate"]-VALID_NEXT_PAGES_TYPE = Literal[None, "sponsorship", "upgrade", "billing", "plans", "deactivate"]+VALID_NEXT_PAGES_TYPE: TypeAlias = Literal[+ None, "sponsorship", "upgrade", "billing", "plans", "deactivate"+]REMOTE_BILLING_SIGNED_ACCESS_TOKEN_VALIDITY_IN_SECONDS = 2 * 60 * 60# We use units of hours here so that we can pass this through to thediff --git a/zerver/tests/test_typed_endpoint.py b/zerver/tests/test_typed_endpoint.pyindex d77c9fc147e..a0d9e719ed3 100644--- a/zerver/tests/test_typed_endpoint.py+++ b/zerver/tests/test_typed_endpoint.py@@ -6,7 +6,7 @@ from django.http import HttpRequest, HttpResponsefrom pydantic import BaseModel, ConfigDict, Json, StringConstraints, ValidationInfo, WrapValidatorfrom pydantic.dataclasses import dataclassfrom pydantic.functional_validators import ModelWrapValidatorHandler-from typing_extensions import Annotated, override+from typing_extensions import Annotated, TypeAlias, overridefrom zerver.lib.exceptions import ApiParamValidationError, JsonableErrorfrom zerver.lib.request import RequestConfusingParamsError, RequestVariableMissingError@@ -26,7 +26,7 @@ from zerver.lib.typed_endpoint import (from zerver.lib.validator import WildValue, check_boolfrom zerver.models import UserProfile-ParamTypes = Literal["none", "json_only", "both"]+ParamTypes: TypeAlias = Literal["none", "json_only", "both"]T = TypeVar("T")