From 4cc4b36f1560e84e20d9e810b6ca713c1f59f24c Mon Sep 17 00:00:00 2001 From: Toshiya Kawasaki Date: Fri, 22 Sep 2017 19:23:10 +0900 Subject: [PATCH] move helper script to scripts dir and add one to Makefile --- Makefile | 4 ++++ .../implementation_coverage.py | 0 setup_new_function.py => scripts/scaffold.py | 2 +- {template => scripts/template}/lib/__init__.py.j2 | 0 {template => scripts/template}/lib/exceptions.py.j2 | 0 {template => scripts/template}/lib/models.py.j2 | 0 {template => scripts/template}/lib/responses.py.j2 | 0 {template => scripts/template}/test/test_server.py.j2 | 0 {template => scripts/template}/test/test_service.py.j2 | 0 9 files changed, 5 insertions(+), 1 deletion(-) rename implementation_coverage.py => scripts/implementation_coverage.py (100%) rename setup_new_function.py => scripts/scaffold.py (99%) rename {template => scripts/template}/lib/__init__.py.j2 (100%) rename {template => scripts/template}/lib/exceptions.py.j2 (100%) rename {template => scripts/template}/lib/models.py.j2 (100%) rename {template => scripts/template}/lib/responses.py.j2 (100%) rename {template => scripts/template}/test/test_server.py.j2 (100%) rename {template => scripts/template}/test/test_service.py.j2 (100%) diff --git a/Makefile b/Makefile index 3c5582c2d..38a73aa28 100644 --- a/Makefile +++ b/Makefile @@ -19,3 +19,7 @@ publish: python setup.py sdist bdist_wheel upload git tag `python setup.py --version` git push origin `python setup.py --version` + +scaffold: + @pip install -r requirements-dev.txt > /dev/null + @python scripts/scaffold.py diff --git a/implementation_coverage.py b/scripts/implementation_coverage.py similarity index 100% rename from implementation_coverage.py rename to scripts/implementation_coverage.py diff --git a/setup_new_function.py b/scripts/scaffold.py similarity index 99% rename from setup_new_function.py rename to scripts/scaffold.py index 0102d74b2..c38544abf 100755 --- a/setup_new_function.py +++ b/scripts/scaffold.py @@ -24,7 +24,7 @@ from implementation_coverage import ( ) from inflection import singularize -TEMPLATE_DIR = './template' +TEMPLATE_DIR = os.path.join(os.path.dirname(__file__), './template') INPUT_IGNORED_IN_BACKEND = ['Marker', 'PageSize'] OUTPUT_IGNORED_IN_BACKEND = ['NextMarker'] diff --git a/template/lib/__init__.py.j2 b/scripts/template/lib/__init__.py.j2 similarity index 100% rename from template/lib/__init__.py.j2 rename to scripts/template/lib/__init__.py.j2 diff --git a/template/lib/exceptions.py.j2 b/scripts/template/lib/exceptions.py.j2 similarity index 100% rename from template/lib/exceptions.py.j2 rename to scripts/template/lib/exceptions.py.j2 diff --git a/template/lib/models.py.j2 b/scripts/template/lib/models.py.j2 similarity index 100% rename from template/lib/models.py.j2 rename to scripts/template/lib/models.py.j2 diff --git a/template/lib/responses.py.j2 b/scripts/template/lib/responses.py.j2 similarity index 100% rename from template/lib/responses.py.j2 rename to scripts/template/lib/responses.py.j2 diff --git a/template/test/test_server.py.j2 b/scripts/template/test/test_server.py.j2 similarity index 100% rename from template/test/test_server.py.j2 rename to scripts/template/test/test_server.py.j2 diff --git a/template/test/test_service.py.j2 b/scripts/template/test/test_service.py.j2 similarity index 100% rename from template/test/test_service.py.j2 rename to scripts/template/test/test_service.py.j2