diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d20508e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM python:2.7.11-alpine + +ADD . /sdk +WORKDIR sdk +RUN python setup.py install + diff --git a/MANIFEST.in b/MANIFEST.in index 84c7124..f989a21 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,4 @@ include LICENSE include requirements.txt +include test-requirements.txt include README.md diff --git a/Makefile b/Makefile deleted file mode 100644 index 0fd86d8..0000000 --- a/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -test:prepare - venv/bin/python setup.py test - -clean: - rm -rf venv build dist *.egg-info - find . -name '*.pyc' -delete - -prepare:clean - set -ex - virtualenv venv - venv/bin/pip install mock - venv/bin/pip install -r requirements.txt - venv/bin/python setup.py install diff --git a/docker-compose.test.yml b/docker-compose.test.yml new file mode 100644 index 0000000..f4d914a --- /dev/null +++ b/docker-compose.test.yml @@ -0,0 +1,3 @@ +sut: + build: . + command: python setup.py test diff --git a/dockercloud/__init__.py b/dockercloud/__init__.py index 1607b62..f8dc072 100644 --- a/dockercloud/__init__.py +++ b/dockercloud/__init__.py @@ -25,7 +25,7 @@ from dockercloud.api.events import Events from dockercloud.api.nodeaz import AZ -__version__ = '1.0.3' +__version__ = '1.0.4' dockercloud_auth = os.environ.get('DOCKERCLOUD_AUTH') basic_auth = auth.load_from_file("~/.docker/config.json") diff --git a/dockercloud/api/base.py b/dockercloud/api/base.py index b375ba4..bc904a5 100644 --- a/dockercloud/api/base.py +++ b/dockercloud/api/base.py @@ -308,7 +308,7 @@ def run_forever(self, *args, **kwargs): on_message=self._on_message, on_error=self._on_error, on_close=self._on_close) - ws.run_forever(ping_interval=5, ping_timeout=5, *args, **kwargs) + ws.run_forever(ping_interval=10, ping_timeout=5, *args, **kwargs) class StreamingLog(StreamingAPI): @@ -329,7 +329,7 @@ def run_forever(self, *args, **kwargs): on_message=self._on_message, on_error=self._on_error, on_close=self._on_close) - ws.run_forever(ping_interval=5, ping_timeout=5, *args, **kwargs) + ws.run_forever(ping_interval=10, ping_timeout=5, *args, **kwargs) class Exec(StreamingAPI): @@ -348,4 +348,4 @@ def run_forever(self, *args, **kwargs): on_message=self._on_message, on_error=self._on_error, on_close=self._on_close) - ws.run_forever(ping_interval=5, ping_timeout=5, *args, **kwargs) + ws.run_forever(ping_interval=10, ping_timeout=5, *args, **kwargs) diff --git a/dockercloud/api/events.py b/dockercloud/api/events.py index 9a3fcfc..ea3bd83 100644 --- a/dockercloud/api/events.py +++ b/dockercloud/api/events.py @@ -39,4 +39,4 @@ def run_forever(self, *args, **kwargs): on_message=self._on_message, on_error=self._on_error, on_close=self._on_close) - ws.run_forever(ping_interval=5, ping_timeout=5, *args, **kwargs) + ws.run_forever(ping_interval=10, ping_timeout=5, *args, **kwargs) diff --git a/hooks/push b/hooks/push new file mode 100755 index 0000000..f966504 --- /dev/null +++ b/hooks/push @@ -0,0 +1,2 @@ +#!/bin/sh +echo "Skipping push the image" diff --git a/requirements.txt b/requirements.txt index 72c0961..fe172c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -backports.ssl-match-hostname==3.4.0.2 future==0.15.0 requests==2.7.0 six==1.9.0 -websocket-client==0.32.0 +websocket-client==0.37.0 diff --git a/setup.py b/setup.py index a833d51..2ab4865 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,13 @@ from setuptools import setup, find_packages +requirements =[ + "future >= 0.15.0, < 1", + "requests >= 2.5.2, < 3", + "six >= 1.3.0, < 2", + "websocket-client >= 0.32.0, < 1" +] + def read(*parts): path = os.path.join(os.path.dirname(__file__), *parts) @@ -19,15 +26,16 @@ def find_version(*file_paths): return version_match.group(1) raise RuntimeError('Unable to find version string.') +with open('./test-requirements.txt') as test_reqs_txt: + test_requirements = [line for line in test_reqs_txt] -with open('requirements.txt') as f: - install_requires = f.read().splitlines() setup( name="python-dockercloud", version=find_version('dockercloud', '__init__.py'), packages=find_packages(), - install_requires=install_requires, + install_requires=requirements, + tests_require=test_requirements, provides=['docker'], include_package_data=True, author="Docker, Inc.", diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..2e8cebf --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1,3 @@ +mock==1.0.1 +coverage==4.0.3 +nose==1.3.7