requirements: Upgrade python-zulip-api from Git.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-03-25 18:27:19 -07:00 committed by Tim Abbott
parent 8737634347
commit d55dc6f8f1
7 changed files with 30 additions and 21 deletions

View File

@ -128,8 +128,8 @@ python-magic
# the version from Git rather than a PyPI release. Keeping everything in # the version from Git rather than a PyPI release. Keeping everything in
# one repository simplifies the process of implementing and documenting # one repository simplifies the process of implementing and documenting
# new bots for new contributors. # new bots for new contributors.
https://github.com/zulip/python-zulip-api/archive/0.7.0.zip/#egg=zulip==0.7.0_git&subdirectory=zulip https://github.com/zulip/python-zulip-api/archive/70f457f82ab3e2fa6fc489f950e46e105dc27ae3.zip#egg=zulip==0.7.1+git&subdirectory=zulip
https://github.com/zulip/python-zulip-api/archive/0.7.0.zip/#egg=zulip_bots==0.7.0+git&subdirectory=zulip_bots https://github.com/zulip/python-zulip-api/archive/70f457f82ab3e2fa6fc489f950e46e105dc27ae3.zip#egg=zulip_bots==0.7.1+git&subdirectory=zulip_bots
# Used for Hesiod lookups, etc. # Used for Hesiod lookups, etc.
py3dns py3dns

View File

@ -1381,7 +1381,6 @@ six==1.15.0 \
# traitlets # traitlets
# twilio # twilio
# w3lib # w3lib
# zulip
snakeviz==2.1.0 \ snakeviz==2.1.0 \
--hash=sha256:8ce375b18ae4a749516d7e6c6fbbf8be6177c53974f53534d8eadb646cd279b1 \ --hash=sha256:8ce375b18ae4a749516d7e6c6fbbf8be6177c53974f53534d8eadb646cd279b1 \
--hash=sha256:92ad876fb6a201a7e23a6b85ea96d9643a51e285667c253a8653643804f7cb68 --hash=sha256:92ad876fb6a201a7e23a6b85ea96d9643a51e285667c253a8653643804f7cb68
@ -1603,6 +1602,7 @@ typing-extensions==3.7.4.3 \
# sqlalchemy-stubs # sqlalchemy-stubs
# typing-inspect # typing-inspect
# zulint # zulint
# zulip-bots
typing-inspect==0.6.0 \ typing-inspect==0.6.0 \
--hash=sha256:3b98390df4d999a28cf5b35d8b333425af5da2ece8a4ea9e98f71e7591347b4f \ --hash=sha256:3b98390df4d999a28cf5b35d8b333425af5da2ece8a4ea9e98f71e7591347b4f \
--hash=sha256:8f1b1dd25908dbfd81d3bebc218011531e7ab614ba6e5bf7826d887c834afab7 \ --hash=sha256:8f1b1dd25908dbfd81d3bebc218011531e7ab614ba6e5bf7826d887c834afab7 \
@ -1740,13 +1740,13 @@ zope.interface==5.3.0 \
https://github.com/zulip/zulint/archive/20508eb8939e909806e6c8018fadfc24e854a02a.zip#egg=zulint==0.0.1 \ https://github.com/zulip/zulint/archive/20508eb8939e909806e6c8018fadfc24e854a02a.zip#egg=zulint==0.0.1 \
--hash=sha256:d3fba0d7232c769b1aaff042315f1d9a92dcc5c522b907c744af457c6752fcd2 --hash=sha256:d3fba0d7232c769b1aaff042315f1d9a92dcc5c522b907c744af457c6752fcd2
# via -r requirements/dev.in # via -r requirements/dev.in
https://github.com/zulip/python-zulip-api/archive/0.7.0.zip/#egg=zulip==0.7.0_git&subdirectory=zulip \ https://github.com/zulip/python-zulip-api/archive/70f457f82ab3e2fa6fc489f950e46e105dc27ae3.zip#egg=zulip==0.7.1+git&subdirectory=zulip \
--hash=sha256:161e3f38a9d27bf76a30da3d3d81f5f1b71a8c2c8144e0c4a33cd15018606d9f --hash=sha256:56efd8b260de2cd5cb80b1fa994c99eeda8d4d91d4b481115a615933a1c74761
# via # via
# -r requirements/common.in # -r requirements/common.in
# zulip-bots # zulip-bots
https://github.com/zulip/python-zulip-api/archive/0.7.0.zip/#egg=zulip_bots==0.7.0+git&subdirectory=zulip_bots \ https://github.com/zulip/python-zulip-api/archive/70f457f82ab3e2fa6fc489f950e46e105dc27ae3.zip#egg=zulip_bots==0.7.1+git&subdirectory=zulip_bots \
--hash=sha256:161e3f38a9d27bf76a30da3d3d81f5f1b71a8c2c8144e0c4a33cd15018606d9f --hash=sha256:56efd8b260de2cd5cb80b1fa994c99eeda8d4d91d4b481115a615933a1c74761
# via -r requirements/common.in # via -r requirements/common.in
zxcvbn==4.4.28 \ zxcvbn==4.4.28 \
--hash=sha256:151bd816817e645e9064c354b13544f85137ea3320ca3be1fb6873ea75ef7dc1 --hash=sha256:151bd816817e645e9064c354b13544f85137ea3320ca3be1fb6873ea75ef7dc1

View File

@ -919,7 +919,6 @@ six==1.15.0 \
# talon-core # talon-core
# traitlets # traitlets
# twilio # twilio
# zulip
social-auth-app-django==4.0.0 \ social-auth-app-django==4.0.0 \
--hash=sha256:2c69e57df0b30c9c1823519c5f1992cbe4f3f98fdc7d95c840e091a752708840 \ --hash=sha256:2c69e57df0b30c9c1823519c5f1992cbe4f3f98fdc7d95c840e091a752708840 \
--hash=sha256:567ad0e028311541d7dfed51d3bf2c60440a6fd236d5d4d06c5a618b3d6c57c5 \ --hash=sha256:567ad0e028311541d7dfed51d3bf2c60440a6fd236d5d4d06c5a618b3d6c57c5 \
@ -1019,6 +1018,7 @@ typing-extensions==3.7.4.3 \
# via # via
# -r requirements/common.in # -r requirements/common.in
# importlib-metadata # importlib-metadata
# zulip-bots
uhashring==2.0 \ uhashring==2.0 \
--hash=sha256:c44c53e88ab01222d3a14346af6aac72a5b3b8ea1a1ddc8d102d0c893bf3e249 --hash=sha256:c44c53e88ab01222d3a14346af6aac72a5b3b8ea1a1ddc8d102d0c893bf3e249
# via python-binary-memcached # via python-binary-memcached
@ -1067,13 +1067,13 @@ zipp==3.4.1 \
--hash=sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76 \ --hash=sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76 \
--hash=sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098 --hash=sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098
# via importlib-metadata # via importlib-metadata
https://github.com/zulip/python-zulip-api/archive/0.7.0.zip/#egg=zulip==0.7.0_git&subdirectory=zulip \ https://github.com/zulip/python-zulip-api/archive/70f457f82ab3e2fa6fc489f950e46e105dc27ae3.zip#egg=zulip==0.7.1+git&subdirectory=zulip \
--hash=sha256:161e3f38a9d27bf76a30da3d3d81f5f1b71a8c2c8144e0c4a33cd15018606d9f --hash=sha256:56efd8b260de2cd5cb80b1fa994c99eeda8d4d91d4b481115a615933a1c74761
# via # via
# -r requirements/common.in # -r requirements/common.in
# zulip-bots # zulip-bots
https://github.com/zulip/python-zulip-api/archive/0.7.0.zip/#egg=zulip_bots==0.7.0+git&subdirectory=zulip_bots \ https://github.com/zulip/python-zulip-api/archive/70f457f82ab3e2fa6fc489f950e46e105dc27ae3.zip#egg=zulip_bots==0.7.1+git&subdirectory=zulip_bots \
--hash=sha256:161e3f38a9d27bf76a30da3d3d81f5f1b71a8c2c8144e0c4a33cd15018606d9f --hash=sha256:56efd8b260de2cd5cb80b1fa994c99eeda8d4d91d4b481115a615933a1c74761
# via -r requirements/common.in # via -r requirements/common.in
zxcvbn==4.4.28 \ zxcvbn==4.4.28 \
--hash=sha256:151bd816817e645e9064c354b13544f85137ea3320ca3be1fb6873ea75ef7dc1 --hash=sha256:151bd816817e645e9064c354b13544f85137ea3320ca3be1fb6873ea75ef7dc1

View File

@ -45,4 +45,4 @@ API_FEATURE_LEVEL = 45
# historical commits sharing the same major version, in which case a # historical commits sharing the same major version, in which case a
# minor version bump suffices. # minor version bump suffices.
PROVISION_VERSION = "134.3" PROVISION_VERSION = "135.0"

View File

@ -1,7 +1,7 @@
import importlib import importlib
import json import json
import os import os
from typing import Any, Callable, Dict from typing import Any, Callable, Dict, Optional
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
@ -23,7 +23,7 @@ from zerver.models import UserProfile, get_active_user
our_dir = os.path.dirname(os.path.abspath(__file__)) our_dir = os.path.dirname(os.path.abspath(__file__))
from zulip_bots.lib import RateLimit from zulip_bots.lib import BotIdentity, RateLimit
def get_bot_handler(service_name: str) -> Any: def get_bot_handler(service_name: str) -> Any:
@ -79,6 +79,12 @@ class EmbeddedBotHandler:
self.storage = StateHandler(user_profile) self.storage = StateHandler(user_profile)
self.user_id = user_profile.id self.user_id = user_profile.id
def identity(self) -> BotIdentity:
return BotIdentity(self.full_name, self.email)
def react(self, message: Dict[str, Any], emoji_name: str) -> Dict[str, Any]:
return {} # Not implemented
def send_message(self, message: Dict[str, Any]) -> None: def send_message(self, message: Dict[str, Any]) -> None:
if not self._rate_limit.is_legal(): if not self._rate_limit.is_legal():
self._rate_limit.show_error_and_exit() self._rate_limit.show_error_and_exit()
@ -108,7 +114,9 @@ class EmbeddedBotHandler:
self.user_profile.realm, self.user_profile, recipients, message["content"] self.user_profile.realm, self.user_profile, recipients, message["content"]
) )
def send_reply(self, message: Dict[str, Any], response: str) -> None: def send_reply(
self, message: Dict[str, Any], response: str, widget_content: Optional[str] = None
) -> None:
if message["type"] == "private": if message["type"] == "private":
self.send_message( self.send_message(
dict( dict(
@ -129,6 +137,9 @@ class EmbeddedBotHandler:
) )
) )
def update_message(self, message: Dict[str, Any]) -> None:
pass # Not implemented
# The bot_name argument exists only to comply with ExternalBotHandler.get_config_info(). # The bot_name argument exists only to comply with ExternalBotHandler.get_config_info().
def get_config_info(self, bot_name: str, optional: bool = False) -> Dict[str, str]: def get_config_info(self, bot_name: str, optional: bool = False) -> Dict[str, str]:
try: try:

View File

@ -1207,12 +1207,11 @@ def update_user_group_members(client: Client, user_group_id: int) -> None:
ensure_users([8, 10, 11], ["cordelia", "hamlet", "iago"]) ensure_users([8, 10, 11], ["cordelia", "hamlet", "iago"])
# {code_example|start} # {code_example|start}
request = { request = {
"group_id": user_group_id,
"delete": [8, 10], "delete": [8, 10],
"add": [11], "add": [11],
} }
result = client.update_user_group_members(request) result = client.update_user_group_members(user_group_id, request)
# {code_example|end} # {code_example|end}
validate_against_openapi_schema(result, "/user_groups/{group_id}/members", "post", "200") validate_against_openapi_schema(result, "/user_groups/{group_id}/members", "post", "200")

View File

@ -31,7 +31,6 @@ from typing import (
Tuple, Tuple,
Type, Type,
TypeVar, TypeVar,
cast,
) )
import orjson import orjson
@ -43,7 +42,7 @@ from django.utils.timezone import now as timezone_now
from django.utils.translation import override as override_language from django.utils.translation import override as override_language
from django.utils.translation import ugettext as _ from django.utils.translation import ugettext as _
from sentry_sdk import add_breadcrumb, configure_scope from sentry_sdk import add_breadcrumb, configure_scope
from zulip_bots.lib import ExternalBotHandler, extract_query_without_mention from zulip_bots.lib import extract_query_without_mention
from zerver.context_processors import common_context from zerver.context_processors import common_context
from zerver.lib.actions import ( from zerver.lib.actions import (
@ -776,7 +775,7 @@ class EmbeddedBotWorker(QueueProcessingWorker):
if event["trigger"] == "mention": if event["trigger"] == "mention":
message["content"] = extract_query_without_mention( message["content"] = extract_query_without_mention(
message=message, message=message,
client=cast(ExternalBotHandler, self.get_bot_api_client(user_profile)), client=self.get_bot_api_client(user_profile),
) )
assert message["content"] is not None assert message["content"] is not None
bot_handler.handle_message( bot_handler.handle_message(