From def9931ebe675d3f5fd9f70284a675a5c6cd2045 Mon Sep 17 00:00:00 2001 From: Joan Valduvieco Date: Mon, 24 Dec 2018 16:41:06 +0100 Subject: [PATCH] Add some files to publish ii --- Pipfile | 2 +- Pipfile.lock | 34 +++++++++++++++++++++++++-------- setup.py | 5 +++-- stdin_to_cloudwatch/__init__.py | 2 +- stdin_to_cloudwatch/__main__.py | 7 ++++++- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/Pipfile b/Pipfile index fe9b17e..68c2161 100644 --- a/Pipfile +++ b/Pipfile @@ -9,11 +9,11 @@ test = "pipenv run python -m unittest discover -s tests -t ." [dev-packages] moto = "*" sure = "*" +pathlib2 = "*" [packages] boto3 = "*" urllib3 = "*" -pathlib = "*" [requires] python_version = "2.7" diff --git a/Pipfile.lock b/Pipfile.lock index 0caf66c..694285d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "198dc53fe62eed1d2929c3be0caabcb59244672f7c9731ce7eb6b9a4ca75a761" + "sha256": "ebd995da30f0b762a9d46b084706e97ac2fd5b7d7c8e76193e1c8c74f6ff258a" }, "pipfile-spec": 6, "requires": { @@ -54,13 +54,6 @@ ], "version": "==0.9.3" }, - "pathlib": { - "hashes": [ - "sha256:6940718dfc3eff4258203ad5021090933e5c04707d5ca8cc9e73c94a7894ea9f" - ], - "index": "pypi", - "version": "==1.0.1" - }, "python-dateutil": { "hashes": [ "sha256:063df5763652e21de43de7d9e00ccf239f953a832941e37be541614732cdfc93", @@ -387,6 +380,14 @@ "index": "pypi", "version": "==1.3.7" }, + "pathlib2": { + "hashes": [ + "sha256:25199318e8cc3c25dcb45cbe084cc061051336d5a9ea2a12448d3d8cb748f742", + "sha256:5887121d7f7df3603bca2f710e7219f3eca0eb69e0b7cc6e0a022e155ac931a7" + ], + "index": "pypi", + "version": "==2.3.3" + }, "pbr": { "hashes": [ "sha256:f59d71442f9ece3dffc17bc36575768e1ee9967756e6b6535f0ee1f0054c3d68", @@ -499,6 +500,23 @@ ], "version": "==0.1.13" }, + "scandir": { + "hashes": [ + "sha256:04b8adb105f2ed313a7c2ef0f1cf7aff4871aa7a1883fa4d8c44b5551ab052d6", + "sha256:1444134990356c81d12f30e4b311379acfbbcd03e0bab591de2696a3b126d58e", + "sha256:1b5c314e39f596875e5a95dd81af03730b338c277c54a454226978d5ba95dbb6", + "sha256:346619f72eb0ddc4cf355ceffd225fa52506c92a2ff05318cfabd02a144e7c4e", + "sha256:44975e209c4827fc18a3486f257154d34ec6eaec0f90fef0cca1caa482db7064", + "sha256:61859fd7e40b8c71e609c202db5b0c1dbec0d5c7f1449dec2245575bdc866792", + "sha256:a5e232a0bf188362fa00123cc0bb842d363a292de7126126df5527b6a369586a", + "sha256:c14701409f311e7a9b7ec8e337f0815baf7ac95776cc78b419a1e6d49889a383", + "sha256:c7708f29d843fc2764310732e41f0ce27feadde453261859ec0fca7865dfc41b", + "sha256:c9009c527929f6e25604aec39b0a43c3f831d2947d89d6caaab22f057b7055c8", + "sha256:f5c71e29b4e2af7ccdc03a020c626ede51da471173b4a6ad1e904f2b2e04b4bd" + ], + "markers": "python_version < '3.5'", + "version": "==1.9.0" + }, "six": { "hashes": [ "sha256:3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", diff --git a/setup.py b/setup.py index b3ec759..f68140a 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ import setuptools -import pathlib +import pathlib2 as pathlib # The directory containing this file HERE = pathlib.Path(__file__).parent @@ -9,7 +9,7 @@ setuptools.setup( name="stdin_to_cloudwatch", - version="0.0.1", + version="0.0.2", author="Joan Valduvieco", author_email="jvalduvieco@gmail.com", description="Intercepts metrics from stding and sends them to AWS cloudwatch", @@ -22,5 +22,6 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], + install_requires=["boto3", "urllib3"], entry_points={"console_scripts": ["stdin_to_cloudwatch=stdin_to_cloudwatch.__main__:main"]}, ) diff --git a/stdin_to_cloudwatch/__init__.py b/stdin_to_cloudwatch/__init__.py index 34d6591..784c395 100644 --- a/stdin_to_cloudwatch/__init__.py +++ b/stdin_to_cloudwatch/__init__.py @@ -1,2 +1,2 @@ name = "stdin_to_cloudwatch" -__version__ = "0.0.1" +__version__ = "0.0.2" diff --git a/stdin_to_cloudwatch/__main__.py b/stdin_to_cloudwatch/__main__.py index 7a53987..cf0fcb2 100644 --- a/stdin_to_cloudwatch/__main__.py +++ b/stdin_to_cloudwatch/__main__.py @@ -6,10 +6,15 @@ from stdin_to_cloudwatch.output_adapters import stdout_print from stdin_to_cloudwatch.stream_consumer import eat_stream_and_publish_metrics_until_the_end -if __name__ == "__main__": + +def main (): client = boto3.client('cloudwatch', region_name=sys.argv[2]) eat_stream_and_publish_metrics_until_the_end(cw_client=client, input_adapter=decide_input_adapter(sys.argv[1]), input_stream=sys.stdin, instance_id=sys.argv[3] if len(sys.argv) == 4 else None, output_function=stdout_print) + + +if __name__ == "__main__": + main()