test_script: Use Python3 style type hints.

This commit is contained in:
Puneeth Chaganti 2020-04-17 12:16:45 +05:30 committed by Tim Abbott
parent 561ded5e59
commit 26e199035d
1 changed files with 4 additions and 9 deletions

View File

@ -6,8 +6,7 @@ from distutils.version import LooseVersion
from version import PROVISION_VERSION
from scripts.lib.zulip_tools import get_dev_uuid_var_path
def get_major_version(v):
# type: (str) -> int
def get_major_version(v: str) -> int:
return int(v.split('.')[0])
def get_version_file():
@ -22,8 +21,7 @@ version %s, and we compare it to the version in source
control (version.py), which is %s.
'''
def preamble(version):
# type: (str) -> str
def preamble(version: str) -> str:
text = PREAMBLE % (version, PROVISION_VERSION)
text += '\n'
return text
@ -45,9 +43,7 @@ is likely to fail until you add dependencies by provisioning.
Do this: `./tools/provision`
'''
def get_provisioning_status():
# type: () -> Tuple[bool, Optional[str]]
def get_provisioning_status() -> Tuple[bool, Optional[str]]:
version_file = get_version_file()
if not os.path.exists(version_file):
# If the developer doesn't have a version_file written by
@ -74,8 +70,7 @@ def get_provisioning_status():
return False, preamble(version) + NEED_TO_UPGRADE
def assert_provisioning_status_ok(force):
# type: (bool) -> None
def assert_provisioning_status_ok(force: bool) -> None:
if not force:
ok, msg = get_provisioning_status()
if not ok: