From e8ba08367bb4bd1ab60c64817c5f843fc00285e1 Mon Sep 17 00:00:00 2001 From: Shoumorup Date: Fri, 1 Feb 2019 18:38:45 +0530 Subject: [PATCH] requirements: Upgrade pyflakes. Pyflakes has been upgraded from 2.0.0 to 2.1.0 and a few new linter errors have been fixed. Fixes #11397. --- requirements/dev.in | 2 +- requirements/dev.txt | 2 +- version.py | 2 +- zerver/lib/request.py | 4 ++-- zerver/tests/test_email_mirror.py | 2 +- zerver/tests/test_settings.py | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/requirements/dev.in b/requirements/dev.in index ee991fb832..3e1920ee74 100644 --- a/requirements/dev.in +++ b/requirements/dev.in @@ -29,7 +29,7 @@ isort==4.3.4 pycodestyle==2.5.0 # Needed to run pyflakes linter -pyflakes==2.0.0 +pyflakes==2.1.0 # Needed to run tests in parallel tblib==1.3.2 diff --git a/requirements/dev.txt b/requirements/dev.txt index abca400690..727f2dfbff 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -126,7 +126,7 @@ pycparser==2.19 # via cffi pycrypto==2.6.1 pycryptodome==3.7.3 # via python-jose pydispatcher==2.0.5 # via scrapy -pyflakes==2.0.0 +pyflakes==2.1.0 pygments==2.3.1 pyhamcrest==1.9.0 # via twisted pyjwt==1.7.1 diff --git a/version.py b/version.py index 8d55d74fe3..7929eead18 100644 --- a/version.py +++ b/version.py @@ -11,4 +11,4 @@ LATEST_RELEASE_ANNOUNCEMENT = "https://blog.zulip.org/2018/11/07/zulip-1-9-relea # Typically, adding a dependency only requires a minor version bump, and # removing a dependency requires a major version bump. -PROVISION_VERSION = '27.5' +PROVISION_VERSION = '28.0' diff --git a/zerver/lib/request.py b/zerver/lib/request.py index f62c1fe184..63b0c63c5a 100644 --- a/zerver/lib/request.py +++ b/zerver/lib/request.py @@ -12,6 +12,7 @@ from django.utils.translation import ugettext as _ from zerver.lib.exceptions import JsonableError, ErrorCode, \ InvalidJSONError +from zerver.lib.types import ViewFuncT from django.http import HttpRequest, HttpResponse @@ -125,8 +126,7 @@ class REQ: # Note that this can't be used in helper functions which are not # expected to call json_error or json_success, as it uses json_error # internally when it encounters an error -def has_request_variables(view_func): - # type: (Callable[[HttpRequest, Any, Any], HttpResponse]) -> Callable[[HttpRequest, *Any, **Any], HttpResponse] +def has_request_variables(view_func: ViewFuncT) -> ViewFuncT: num_params = view_func.__code__.co_argcount if view_func.__defaults__ is None: num_default_params = 0 diff --git a/zerver/tests/test_email_mirror.py b/zerver/tests/test_email_mirror.py index 1da6202db9..cfa4338ae2 100644 --- a/zerver/tests/test_email_mirror.py +++ b/zerver/tests/test_email_mirror.py @@ -620,7 +620,7 @@ class TestStreamEmailMessagesSubjectStripping(ZulipTestCase): process_message(incoming_valid_message) message = most_recent_message(user_profile) - if subject['stripped_subject'] is not "": + if subject['stripped_subject'] != "": expected_topic = subject['stripped_subject'] else: expected_topic = "(no topic)" diff --git a/zerver/tests/test_settings.py b/zerver/tests/test_settings.py index 2b6b1514c4..3508822302 100644 --- a/zerver/tests/test_settings.py +++ b/zerver/tests/test_settings.py @@ -136,7 +136,7 @@ class ChangeSettingsTest(ZulipTestCase): # doesn't work for it. # # TODO: Make this work more like do_test_realm_update_api - if notification_setting is not 'notification_sound': + if notification_setting != 'notification_sound': self.check_for_toggle_param_patch("/json/settings/notifications", notification_setting)