From a90e216b0d43949d4e7bf5ed2821b899c6a95bad Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sat, 3 Sep 2016 19:01:27 +0300
Subject: [PATCH] - Ran source through yapf. - Added fabfile. - Correct
 classifier in setup.py. - Bumped patch version.

---
 VERSION              |  2 +-
 eb_prune/__init__.py | 20 ++++++++++----------
 fabfile.py           | 23 +++++++++++++++++++++++
 setup.py             |  2 +-
 4 files changed, 35 insertions(+), 12 deletions(-)
 create mode 100644 fabfile.py

diff --git a/VERSION b/VERSION
index 9325c3c..a2268e2 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.3.0
\ No newline at end of file
+0.3.1
\ No newline at end of file
diff --git a/eb_prune/__init__.py b/eb_prune/__init__.py
index ba5bcf0..23512e4 100644
--- a/eb_prune/__init__.py
+++ b/eb_prune/__init__.py
@@ -1,7 +1,7 @@
 #!/usr/bin/env python
 '''Prune older versions of an application in Elastic Beanstalk.'''
-from __future__ import (absolute_import, division,
-                        print_function, unicode_literals)
+from __future__ import (absolute_import, division, print_function,
+                        unicode_literals)
 from argparse import ArgumentParser
 from botocore import session
 
@@ -26,9 +26,9 @@ def prune(versions_to_keep, dry_run):
         lambda x: (not x['VersionLabel'] in active_versions) and
         x['Status'] == 'UNPROCESSED', versions)
     # Remove the newest versions from the list.
-    old_versions = sorted(previous_versions,
-                          key=lambda x:
-                          x.get('DateCreated'))[:-versions_to_keep]
+    old_versions = sorted(
+        previous_versions,
+        key=lambda x: x.get('DateCreated'))[:-versions_to_keep]
     for version in old_versions:
         if not dry_run:
             response = beanstalk_client.delete_application_version(
@@ -36,11 +36,10 @@ def prune(versions_to_keep, dry_run):
                 VersionLabel=version['VersionLabel'],
                 DeleteSourceBundle=True)
             if response['ResponseMetadata']['HTTPStatusCode'] != 200:
-                raise RuntimeError(
-                    'Failed to delete version {0}.'.format(
-                        version['VersionLabel']))
+                raise RuntimeError('Failed to delete version {0}.'.format(
+                    version['VersionLabel']))
         print('Deleted version {0} of {1}.'.format(version['VersionLabel'],
-              version['ApplicationName']))
+                                                   version['ApplicationName']))
     print('Deleted {0} versions.'.format(len(old_versions)))
 
 
@@ -49,7 +48,8 @@ def main():
     parser.add_argument('versions_to_keep',
                         help='The number of versions to keep.',
                         type=int)
-    parser.add_argument('-d', '--dry-run',
+    parser.add_argument('-d',
+                        '--dry-run',
                         help='Dry run, do not delete versions.',
                         action='store_true')
     args = parser.parse_args()
diff --git a/fabfile.py b/fabfile.py
new file mode 100644
index 0000000..c34c2fa
--- /dev/null
+++ b/fabfile.py
@@ -0,0 +1,23 @@
+from __future__ import (absolute_import, division, print_function,
+                        unicode_literals)
+from fabric.api import (local, task, env)
+
+env.use_ssh_config = True
+
+
+@task
+def build():
+    '''Build wheel.'''
+    local('''python setup.py sdist bdist_wheel''')
+
+
+@task
+def clean():
+    '''Clean.'''
+    local('''rm -rf *.pyc *.egg-info build dist''')
+
+
+@task
+def upload():
+    build()
+    local('''twine upload -s dist/*''')
diff --git a/setup.py b/setup.py
index 1be51cc..3bfc90f 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ setup(
     author_email='nimrod@shore.co.il',
     license='MIT',
     classifiers=[
-        'Development status :: 4 - Beta',
+        'Development Status :: 4 - Beta',
         'Intended Audience :: Developers',
         'Programming Language :: Python :: 3',
         'Programming Language :: Python :: 2',
-- 
GitLab