Skip to content

Commit

Permalink
Update requirements.txt
Browse files Browse the repository at this point in the history
Create make target 'requirements' to deal with pkg-resources bug caused
by ubuntu passing incorrect metadata to pip (see link).

pypa/pip#4022
  • Loading branch information
carpntr committed Nov 5, 2017
1 parent 6f516b4 commit 2e9424b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Makefile
Expand Up @@ -7,3 +7,6 @@ mongo:
test:
pytest --cov=exchanges

requirements:
pip freeze | grep -v "pkg-resources" > requirements.txt

Empty file.
30 changes: 30 additions & 0 deletions exchanges/cryptocompare/client.py
@@ -0,0 +1,30 @@
import requests
import json
import pprint
import asyncio
import websocket


class CCWebSocket:
ws_protocol = 'wss'
ws_host = 'streamer.cryptocompare.com'

def __init__(self):
self.url = f'{self.ws_protocol}://{self.ws_host}'
self.ws = websockets
def add_sub(self):
sub_string = {'subs':['0~Poloniex~BTC~USD']}
self.ws.send(json.dumps(sub_string))
self.ws.run_forever()

def stream(self):
self.ws = websocket.WebSocketApp(self.url,
on_message=self._handle_message,
on_error=self._handle_message)


def _handle_message(self, ws, msg):
print(msg)

sock = CCWebSocket()
sock.add_sub()
5 changes: 3 additions & 2 deletions requirements.txt
@@ -1,3 +1,4 @@
arctic==1.55.0
certifi==2017.7.27.1
chardet==3.0.4
coverage==4.4.1
Expand All @@ -11,14 +12,14 @@ idna==2.6
mockextras==1.0.2
multidict==3.3.0
numpy==1.13.3
pandas==0.20.3
pandas==0.21.0
py==1.4.34
pyaml==17.10.0
pymongo==3.5.1
pytest==3.2.3
pytest-cov==2.5.1
python-dateutil==2.6.1
pytz==2017.2
pytz==2017.3
PyYAML==3.12
requests==2.18.4
six==1.11.0
Expand Down

0 comments on commit 2e9424b

Please sign in to comment.