From bb6e96bcc1eb677f44debe4536dbff3b785ecbcd Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Fri, 18 Jan 2019 15:36:56 +0900 Subject: [PATCH 1/5] Move test --- {drucker/test => test}/__init__.py | 4 ++-- {drucker/test => test}/dummy_app.py | 0 {drucker/test => test}/test-settings.yml | 0 {drucker/test => test}/test_dashboard_servicer.py | 0 {drucker/test => test}/test_worker_servicer.py | 8 ++++---- 5 files changed, 6 insertions(+), 6 deletions(-) rename {drucker/test => test}/__init__.py (74%) rename {drucker/test => test}/dummy_app.py (100%) rename {drucker/test => test}/test-settings.yml (100%) rename {drucker/test => test}/test_dashboard_servicer.py (100%) rename {drucker/test => test}/test_worker_servicer.py (98%) diff --git a/drucker/test/__init__.py b/test/__init__.py similarity index 74% rename from drucker/test/__init__.py rename to test/__init__.py index 1a83812..4bd3d60 100644 --- a/drucker/test/__init__.py +++ b/test/__init__.py @@ -1,12 +1,12 @@ import os from drucker.logger import JsonServiceLogger, JsonSystemLogger -from drucker.test.dummy_app import DummyApp +from test.dummy_app import DummyApp import drucker.drucker_worker_servicer os.environ["DRUCKER_TEST_MODE"] = "True" -os.environ["DRUCKER_SETTINGS_YAML"] = "drucker/test/test-settings.yml" +os.environ["DRUCKER_SETTINGS_YAML"] = "test/test-settings.yml" app = DummyApp() service_logger = JsonServiceLogger(app.config) diff --git a/drucker/test/dummy_app.py b/test/dummy_app.py similarity index 100% rename from drucker/test/dummy_app.py rename to test/dummy_app.py diff --git a/drucker/test/test-settings.yml b/test/test-settings.yml similarity index 100% rename from drucker/test/test-settings.yml rename to test/test-settings.yml diff --git a/drucker/test/test_dashboard_servicer.py b/test/test_dashboard_servicer.py similarity index 100% rename from drucker/test/test_dashboard_servicer.py rename to test/test_dashboard_servicer.py diff --git a/drucker/test/test_worker_servicer.py b/test/test_worker_servicer.py similarity index 98% rename from drucker/test/test_worker_servicer.py rename to test/test_worker_servicer.py index 590ec0a..55de1b0 100644 --- a/drucker/test/test_worker_servicer.py +++ b/test/test_worker_servicer.py @@ -30,12 +30,12 @@ def patch_predictor(input_type, output_type): def test_method(func): @wraps(func) def inner_method(*args, **kwargs): - with patch('drucker.test.dummy_app.DummyApp.get_type_input', + with patch('test.dummy_app.DummyApp.get_type_input', new=Mock(return_value=input_type)) as _, \ - patch('drucker.test.dummy_app.DummyApp.get_type_output', + patch('test.dummy_app.DummyApp.get_type_output', new=Mock(return_value=output_type)) as _, \ - patch('drucker.test.dummy_app.DummyApp.load_model') as _, \ - patch('drucker.test.dummy_app.DummyApp.predict', + patch('test.dummy_app.DummyApp.load_model') as _, \ + patch('test.dummy_app.DummyApp.predict', new=Mock(return_value=_prediction_value_map[output_type])) as _: return func(*args, **kwargs) return inner_method From c3e0c117dcf6e8309ad15df3b3d30750b2fb594d Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Fri, 18 Jan 2019 15:37:33 +0900 Subject: [PATCH 2/5] Add py37 unittest env --- .travis.yml | 4 +++- setup.py | 1 + tox.ini | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index fe413c3..eeae632 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: python -dist: trusty +dist: xenial sudo: true services: - docker @@ -9,6 +9,8 @@ matrix: env: TOXENV=py36 - python: 3.6 env: TOXENV=coverage,codecov + - python: 3.7 + env: TOXENV=py37 install: - pip install tox script: diff --git a/setup.py b/setup.py index 2455edb..16c0dbd 100644 --- a/setup.py +++ b/setup.py @@ -76,5 +76,6 @@ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", ], ) diff --git a/tox.ini b/tox.ini index 07794e7..8327531 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36 +envlist = py36, py37 [testenv] passenv = TOXENV CI TRAVIS TRAVIS_* From fc3ba9543bba65c90934cd3ce6de1c2f5e2d6c16 Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Fri, 18 Jan 2019 16:31:09 +0900 Subject: [PATCH 3/5] Update libraries --- requirements.txt | 12 ++++++------ test-requirements.txt | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/requirements.txt b/requirements.txt index d1b09b9..7bc2b24 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ fluent-logger==0.9.3 -python-json-logger==0.1.9 -grpcio==1.13.0 -grpcio-tools==1.13.0 -PyMySQL==0.8.0 -SQLAlchemy==1.2.7 -PyYAML==3.12 +python-json-logger==0.1.10 +grpcio==1.18.0 +grpcio-tools==1.18.0 +PyMySQL==0.9.3 +SQLAlchemy==1.2.16 +PyYAML==3.13 diff --git a/test-requirements.txt b/test-requirements.txt index 238ba1c..abb3dc7 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ -coverage==4.5.1 +coverage==4.5.2 nose==1.3.7 -pytest -py==1.5.4 +pytest==4.1.1 +py==1.7.0 codecov==2.0.15 -grpcio-testing==1.13.0 +grpcio-testing==1.18.0 From 194d85cf3316e24a5b86d5efd31c6493bec0363d Mon Sep 17 00:00:00 2001 From: Hattori Keigo Date: Fri, 18 Jan 2019 17:12:37 +0900 Subject: [PATCH 4/5] Update requirements.txt --- requirements.txt | 14 +++++++------- test-requirements.txt | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/requirements.txt b/requirements.txt index 7bc2b24..b4d8173 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ -fluent-logger==0.9.3 -python-json-logger==0.1.10 -grpcio==1.18.0 -grpcio-tools==1.18.0 -PyMySQL==0.9.3 -SQLAlchemy==1.2.16 -PyYAML==3.13 +fluent-logger>=0.9.3 # Apache-2.0 +python-json-logger>=0.1.9 # BSD +grpcio>=1.13.0 # Apache-2.0 +grpcio-tools>=1.13.0 # Apache-2.0 +PyMySQL>=0.8.0 # MIT +SQLAlchemy>=1.2.7 # MIT +PyYAML>=3.13 # MIT diff --git a/test-requirements.txt b/test-requirements.txt index abb3dc7..51cfc7d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,6 +1,6 @@ -coverage==4.5.2 -nose==1.3.7 -pytest==4.1.1 -py==1.7.0 -codecov==2.0.15 -grpcio-testing==1.18.0 +coverage>=4.0.3 +nose>=1.3.7 +pytest +py>=1.4.31 +codecov>=1.4.0 +grpcio-testing>=1.13.0 From 5ac087c4e70107ae8c32257ace4bc913cbd6d648 Mon Sep 17 00:00:00 2001 From: Keigo Hattori Date: Mon, 21 Jan 2019 10:27:28 +0900 Subject: [PATCH 5/5] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index b4d8173..8b72fb6 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,4 +4,4 @@ grpcio>=1.13.0 # Apache-2.0 grpcio-tools>=1.13.0 # Apache-2.0 PyMySQL>=0.8.0 # MIT SQLAlchemy>=1.2.7 # MIT -PyYAML>=3.13 # MIT +PyYAML>=3.12 # MIT