From cb9a7ce01e817fdfb681872588484508a8b8899b Mon Sep 17 00:00:00 2001 From: Mohamad Nour Chawich Date: Wed, 13 Apr 2016 17:08:34 +0200 Subject: [PATCH 1/6] Update requirements.txt Old version of websocket-client has many bugs that were fixed. Some were causing issues in dependencies like this one docker/dockercloud-haproxy#15 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 72c0961..7540a8f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,4 +2,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.36.0 From af475584102596428f65d6ff1e558af270edc67e Mon Sep 17 00:00:00 2001 From: tifayuki Date: Thu, 14 Apr 2016 13:00:48 +0200 Subject: [PATCH 2/6] use abstract dependency instead of concrete ones --- requirements.txt | 1 - setup.py | 11 +++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7540a8f..ec72cca 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -backports.ssl-match-hostname==3.4.0.2 future==0.15.0 requests==2.7.0 six==1.9.0 diff --git a/setup.py b/setup.py index a833d51..ed5b22e 100644 --- a/setup.py +++ b/setup.py @@ -4,6 +4,12 @@ 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) @@ -20,14 +26,11 @@ def find_version(*file_paths): raise RuntimeError('Unable to find version string.') -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, provides=['docker'], include_package_data=True, author="Docker, Inc.", From be9d7151507fbe9de4e269d33801a4865bf5a44e Mon Sep 17 00:00:00 2001 From: tifayuki Date: Tue, 19 Apr 2016 17:44:28 +0200 Subject: [PATCH 3/6] change ws ping_interval to adapt new version of ws client --- dockercloud/api/base.py | 6 +++--- dockercloud/api/events.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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) From 91dfe343ed6902976f95e4048376c987a5e6b56f Mon Sep 17 00:00:00 2001 From: tifayuki Date: Tue, 19 Apr 2016 19:03:40 +0200 Subject: [PATCH 4/6] remove makefile and add test-requirements --- MANIFEST.in | 1 + Makefile | 13 ------------- setup.py | 5 +++++ test-requirements.txt | 3 +++ 4 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 Makefile create mode 100644 test-requirements.txt 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/setup.py b/setup.py index ed5b22e..2ab4865 100644 --- a/setup.py +++ b/setup.py @@ -11,6 +11,7 @@ "websocket-client >= 0.32.0, < 1" ] + def read(*parts): path = os.path.join(os.path.dirname(__file__), *parts) with codecs.open(path, encoding='utf-8') as fobj: @@ -25,12 +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] + setup( name="python-dockercloud", version=find_version('dockercloud', '__init__.py'), packages=find_packages(), 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 From aef85ca5ec5bbbb2501e397d30e50737d7725c7e Mon Sep 17 00:00:00 2001 From: tifayuki Date: Tue, 19 Apr 2016 19:16:33 +0200 Subject: [PATCH 5/6] bump ver --- dockercloud/__init__.py | 2 +- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/requirements.txt b/requirements.txt index ec72cca..fe172c4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ future==0.15.0 requests==2.7.0 six==1.9.0 -websocket-client==0.36.0 +websocket-client==0.37.0 From ed92451219f6ea38ed01aea88b3b863d7d1eca4c Mon Sep 17 00:00:00 2001 From: tifayuki Date: Tue, 26 Apr 2016 12:51:36 +0200 Subject: [PATCH 6/6] add tests for CI --- Dockerfile | 6 ++++++ docker-compose.test.yml | 3 +++ hooks/push | 2 ++ 3 files changed, 11 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.test.yml create mode 100755 hooks/push 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/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/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"