requirements: Update requirements/ to install bots/API packages.

This is required, since we just reorganized the python-zulip-api
repository into 3 packages.

A nice side effect is that we get to eliminate some now-unnecessary
code for editing sys.path.
This commit is contained in:
Eeshan Garg 2017-07-18 03:30:28 -02:30 committed by Tim Abbott
parent ec669a0c45
commit 148bb4db09
5 changed files with 9 additions and 11 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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):

View File

@ -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()