diff --git a/requirements/common.txt b/requirements/common.txt index b566ab8452..370cd8046f 100644 --- a/requirements/common.txt +++ b/requirements/common.txt @@ -168,4 +168,5 @@ beautifulsoup4==4.6.0 # The Zulip API bindings, from its own repository. # We integrate with these tightly, so often it makes sense to pin a # version from Git rather than a release. --e git+https://github.com/zulip/python-zulip-api.git@7910d8767a38feedcdaa12838f1978d15a013f7c#egg=zulip==0.3.1 +-e "git+https://github.com/zulip/python-zulip-api.git@b08a37fe9c3ebb73ddab3b95fa33db5db6f2e274#egg=zulip==0.3.1&subdirectory=zulip" +-e "git+https://github.com/zulip/python-zulip-api.git@b08a37fe9c3ebb73ddab3b95fa33db5db6f2e274#egg=zulip_bots==0.3.1&subdirectory=zulip_bots" diff --git a/requirements/py2_common_lock.txt b/requirements/py2_common_lock.txt index 829ff6b04d..56083ddb13 100644 --- a/requirements/py2_common_lock.txt +++ b/requirements/py2_common_lock.txt @@ -8,7 +8,8 @@ git+https://github.com/sharmaeklavya2/PyAPNs.git@remove-simplejson#egg=apns==2.0 git+https://github.com/rafaelmartins/pyoembed.git@eb9901917c2a44b49e2887c077ead84a722c50dc#egg=pyoembed git+https://github.com/umairwaheed/talon.git@7d8bdc4dbcfcc5a73298747293b99fe53da55315#egg=talon==1.2.11 git+https://github.com/umairwaheed/virtualenv-clone.git@short-version#egg=virtualenv-clone==0.2.6 -git+https://github.com/zulip/python-zulip-api.git@7910d8767a38feedcdaa12838f1978d15a013f7c#egg=zulip==0.3.1 +git+https://github.com/zulip/python-zulip-api.git@b08a37fe9c3ebb73ddab3b95fa33db5db6f2e274#egg=zulip==0.3.1&subdirectory=zulip +git+https://github.com/zulip/python-zulip-api.git@b08a37fe9c3ebb73ddab3b95fa33db5db6f2e274#egg=zulip_bots==0.3.1&subdirectory=zulip_bots argon2-cffi==16.3.0 asn1crypto==0.22.0 # via cryptography backports-abc==0.5 diff --git a/requirements/py3_common_lock.txt b/requirements/py3_common_lock.txt index 7ee9d88514..a4bacfa989 100644 --- a/requirements/py3_common_lock.txt +++ b/requirements/py3_common_lock.txt @@ -8,7 +8,8 @@ git+https://github.com/sharmaeklavya2/PyAPNs.git@remove-simplejson#egg=apns==2.0 git+https://github.com/rafaelmartins/pyoembed.git@eb9901917c2a44b49e2887c077ead84a722c50dc#egg=pyoembed git+https://github.com/umairwaheed/talon.git@7d8bdc4dbcfcc5a73298747293b99fe53da55315#egg=talon==1.2.11 git+https://github.com/umairwaheed/virtualenv-clone.git@short-version#egg=virtualenv-clone==0.2.6 -git+https://github.com/zulip/python-zulip-api.git@7910d8767a38feedcdaa12838f1978d15a013f7c#egg=zulip==0.3.1 +git+https://github.com/zulip/python-zulip-api.git@b08a37fe9c3ebb73ddab3b95fa33db5db6f2e274#egg=zulip==0.3.1&subdirectory=zulip +git+https://github.com/zulip/python-zulip-api.git@b08a37fe9c3ebb73ddab3b95fa33db5db6f2e274#egg=zulip_bots==0.3.1&subdirectory=zulip_bots argon2-cffi==16.3.0 asn1crypto==0.22.0 # via cryptography backports-abc==0.5 diff --git a/zerver/lib/bot_lib.py b/zerver/lib/bot_lib.py index 76f8f68656..4f3c4ed1a6 100644 --- a/zerver/lib/bot_lib.py +++ b/zerver/lib/bot_lib.py @@ -19,11 +19,7 @@ from types import ModuleType our_dir = os.path.dirname(os.path.abspath(__file__)) -# For dev setups, we can find the API in the repo itself. -if os.path.exists(os.path.join(our_dir, '../../api')): - sys.path.insert(0, os.path.join(our_dir, '../../api')) - -from bots_api.bot_lib import RateLimit, send_reply +from zulip_bots.lib import RateLimit, send_reply class EmbeddedBotHandler(object): def __init__(self, user_profile): diff --git a/zerver/worker/queue_processors.py b/zerver/worker/queue_processors.py index 09f8ed2538..9360f6e2df 100644 --- a/zerver/worker/queue_processors.py +++ b/zerver/worker/queue_processors.py @@ -5,9 +5,8 @@ from typing import Any, Callable, Dict, List, Mapping, Optional, cast import signal import sys import os -sys.path.insert(0, os.path.normpath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '../../api'))) -from bots_api.bot_lib import ExternalBotHandler, StateHandler +from zulip_bots.lib import ExternalBotHandler, StateHandler from django.conf import settings from django.db import connection from django.core.handlers.wsgi import WSGIRequest @@ -481,7 +480,7 @@ class EmbeddedBotWorker(QueueProcessingWorker): def get_bot_handler(self, service): # type: (Service) -> Any - bot_module_name = 'bots_api.bots.%s.%s' % (service.name, service.name) + bot_module_name = 'zulip_bots.bots.%s.%s' % (service.name, service.name) bot_module = importlib.import_module(bot_module_name) # type: Any return bot_module.handler_class()