From 9dcdb06728fc6563f0592cda3c6c587d129e8fb8 Mon Sep 17 00:00:00 2001 From: AvengerPenguin Date: Tue, 3 Apr 2018 14:22:48 +0100 Subject: [PATCH 1/3] Only require argparse in Python 2.6 as this actually breaks Py27 in CentOS --- setup.py | 11 +++++++++-- tox.ini | 4 ++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 tox.ini diff --git a/setup.py b/setup.py index 80739d9..768dff9 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from cloudwatchmon import VERSION import os.path - +import sys from setuptools import find_packages, setup @@ -12,6 +12,13 @@ def readme(): return f.read() +requires = ['boto>=2.33.0',] + + + if sys.version_info == (2, 6): + requires += ['argparse'] + + setup(name='cloudwatchmon', version=VERSION, description='Linux monitoring scripts for CloudWatch', @@ -23,7 +30,7 @@ def readme(): keywords="monitoring cloudwatch amazon web services aws ec2", zip_safe=True, packages=find_packages(), - install_requires=['boto>=2.33.0', 'argparse'], + install_requires=requires, entry_points={'console_scripts': [ 'mon-get-instance-stats.py=cloudwatchmon.cli.get_instance_stats:main', 'mon-put-instance-stats.py=cloudwatchmon.cli.put_instance_stats:main', diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..e6670d7 --- /dev/null +++ b/tox.ini @@ -0,0 +1,4 @@ +[tox] +envlist = py26,py27,py33,py34,py35,py36 +[testenv] +commands=mon-get-instance-stats.py --version From b50c1a8363e60dc01eabb6701c0ac680563571ee Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Wed, 16 Jan 2019 08:36:19 +0000 Subject: [PATCH 2/3] Only check major/minor part of Python version info --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 768dff9..fda902e 100755 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ def readme(): requires = ['boto>=2.33.0',] - if sys.version_info == (2, 6): + if sys.version_info[:2] == (2, 6): requires += ['argparse'] From 7f927f7a82abc373443f308fef2a9fb208527073 Mon Sep 17 00:00:00 2001 From: Ross Fenning Date: Wed, 16 Jan 2019 08:40:13 +0000 Subject: [PATCH 3/3] Only check major/minor part of Python version info