Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
settings: Convert variable type annotations to Python 3.6 style.
Anders Kaseorg5693f63bf8df
diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.pyindex e9d13af2f02..a7a9392df8d 100644--- a/tools/linter_lib/custom_check.py+++ b/tools/linter_lib/custom_check.py@@ -335,9 +335,7 @@ python_rules = RuleList('exclude': {'scripts/lib/hash_reqs.py','scripts/lib/setup_venv.py','scripts/lib/zulip_tools.py',- 'tools/lib/provision.py',- 'zproject/dev_settings.py',- 'zproject/prod_settings_template.py'},+ 'tools/lib/provision.py'},'description': 'Comment-style variable type annotation. Use Python 3.6 style annotations instead.','good_lines': ['a: List[int] = []'],'bad_lines': ['a = [] # type: List[int]']},diff --git a/zproject/default_settings.py b/zproject/default_settings.pyindex 96896cf2f9d..e4245cb44b4 100644--- a/zproject/default_settings.py+++ b/zproject/default_settings.py@@ -39,6 +39,7 @@ EMAIL_HOST: Optional[str] = None# LDAP authAUTH_LDAP_SERVER_URI = ""+LDAP_APPEND_DOMAIN: Optional[str] = NoneLDAP_EMAIL_ATTR: Optional[str] = NoneAUTH_LDAP_USERNAME_ATTR: Optional[str] = NoneAUTH_LDAP_REVERSE_EMAIL_SEARCH: Optional["LDAPSearch"] = Nonediff --git a/zproject/dev_settings.py b/zproject/dev_settings.pyindex 21848bb15a0..6100ddb61ef 100644--- a/zproject/dev_settings.py+++ b/zproject/dev_settings.py@@ -45,7 +45,7 @@ ALLOWED_HOSTS = ['*']# Uncomment extra backends if you want to test with them. Note that# for Google and GitHub auth you'll need to do some pre-setup.-AUTHENTICATION_BACKENDS = (+AUTHENTICATION_BACKENDS: Tuple[str, ...] = ('zproject.backends.DevAuthBackend','zproject.backends.EmailAuthBackend','zproject.backends.GitHubAuthBackend',@@ -54,7 +54,7 @@ AUTHENTICATION_BACKENDS = (# 'zproject.backends.AzureADAuthBackend','zproject.backends.GitLabAuthBackend','zproject.backends.AppleAuthBackend',-) # type: Tuple[str, ...]+)EXTERNAL_URI_SCHEME = "http://"EMAIL_GATEWAY_PATTERN = "%s@" + EXTERNAL_HOST_WITHOUT_PORT@@ -76,10 +76,10 @@ SAVE_FRONTEND_STACKTRACES = TrueEVENT_LOGS_ENABLED = TrueSTAGING_ERROR_NOTIFICATIONS = True-SYSTEM_ONLY_REALMS = set() # type: Set[str]+SYSTEM_ONLY_REALMS: Set[str] = set()USING_PGROONGA = True# Flush cache after migration.-POST_MIGRATION_CACHE_FLUSHING = True # type: bool+POST_MIGRATION_CACHE_FLUSHING = True# Don't require anything about password strength in developmentPASSWORD_MIN_LENGTH = 0@@ -98,7 +98,7 @@ TWO_FACTOR_SMS_GATEWAY = 'two_factor.gateways.fake.Fake'SENDFILE_BACKEND = 'django_sendfile.backends.development'# Set this True to send all hotspots in development-ALWAYS_SEND_ALL_HOTSPOTS = False # type: bool+ALWAYS_SEND_ALL_HOTSPOTS = False# FAKE_LDAP_MODE supports using a fake LDAP database in the# development environment, without needing an LDAP server!@@ -112,7 +112,7 @@ ALWAYS_SEND_ALL_HOTSPOTS = False # type: bool# (C) If LDAP usernames are completely unrelated to email addresses.## Fake LDAP data has e.g. ("ldapuser1", "[email protected]") for username/email.-FAKE_LDAP_MODE = None # type: Optional[str]+FAKE_LDAP_MODE: Optional[str] = None# FAKE_LDAP_NUM_USERS = 8if FAKE_LDAP_MODE:diff --git a/zproject/prod_settings_template.py b/zproject/prod_settings_template.pyindex bcb14f60332..986405d22b1 100644--- a/zproject/prod_settings_template.py+++ b/zproject/prod_settings_template.py@@ -1,4 +1,4 @@-from typing import Any, Dict, Optional, Tuple+from typing import Any, Dict, Tuple################################################################# Zulip Server settings.@@ -115,7 +115,7 @@ EXTERNAL_HOST = 'zulip.example.com'# The install process requires EmailAuthBackend (the default) to be# enabled. If you want to disable it, do so after creating the# initial realm and user.-AUTHENTICATION_BACKENDS = (+AUTHENTICATION_BACKENDS: Tuple[str, ...] = ('zproject.backends.EmailAuthBackend', # Email and password; just requires SMTP setup# 'zproject.backends.GoogleAuthBackend', # Google auth, setup below# 'zproject.backends.GitHubAuthBackend', # GitHub auth, setup below@@ -125,7 +125,7 @@ AUTHENTICATION_BACKENDS = (# 'zproject.backends.SAMLAuthBackend', # SAML, setup below# 'zproject.backends.ZulipLDAPAuthBackend', # LDAP, setup below# 'zproject.backends.ZulipRemoteUserBackend', # Local SSO, setup docs on readthedocs-) # type: Tuple[str, ...]+)######### Google OAuth.@@ -267,12 +267,12 @@ SOCIAL_AUTH_SAML_ENABLED_IDPS = {},}-SOCIAL_AUTH_SAML_SECURITY_CONFIG = {+SOCIAL_AUTH_SAML_SECURITY_CONFIG: Dict[str, Any] = {# If you've set up the optional private and public server keys,# set this to True to enable signing of SAMLRequests using the# private key."authnRequestsSigned": False,-} # type: Dict[str, Any]+}# These SAML settings you likely won't need to modify.SOCIAL_AUTH_SAML_SP_ENTITY_ID = 'https://' + EXTERNAL_HOST@@ -317,10 +317,11 @@ SOCIAL_AUTH_SAML_SUPPORT_CONTACT = {# SSO via REMOTE_USER.## If you are using the ZulipRemoteUserBackend authentication backend,-# set this to your domain (e.g. if REMOTE_USER is "username" and the-# corresponding email address is "[email protected]", set-# SSO_APPEND_DOMAIN = "example.com")-SSO_APPEND_DOMAIN = None # type: Optional[str]+# and REMOTE_USER does not already include a domain, set this to your+# domain (e.g. if REMOTE_USER is "username" and the corresponding+# email address is "[email protected]", set SSO_APPEND_DOMAIN =+# "example.com"), otherwise leave this as None.+#SSO_APPEND_DOMAIN = None################# Miscellaneous settings.@@ -548,13 +549,13 @@ AUTH_LDAP_USER_SEARCH = LDAPSearch("ou=users,dc=example,dc=com",# their email address is "[email protected]", set LDAP_APPEND_DOMAIN to# "example.com". Otherwise, leave LDAP_APPEND_DOMAIN=None and set# AUTH_LDAP_REVERSE_EMAIL_SEARCH and AUTH_LDAP_USERNAME_ATTR below.-LDAP_APPEND_DOMAIN = None # type: Optional[str]+#LDAP_APPEND_DOMAIN = None# LDAP attribute to find a user's email address.## Leave as None if users log in with their email addresses,# or if using LDAP_APPEND_DOMAIN.-LDAP_EMAIL_ATTR = None # type: Optional[str]+#LDAP_EMAIL_ATTR = None# AUTH_LDAP_REVERSE_EMAIL_SEARCH works like AUTH_LDAP_USER_SEARCH and# should query an LDAP user given their email address. It and