Skip to content
Snippets Groups Projects
Commit 1483774b authored by nimrod's avatar nimrod
Browse files

- Renamed Python module to eb_prune (otherwise import fails).

- Added log files and .tox to gitignore.
- Beginning work on README file (just heading, single note and TODO list for
  now).
- Added MANIFEST.in.
- Refactored code in to a main function (for console script).
- Added setup.cfg.
- Specify Python 3.5 and 2.7 (what I have available locally for testing).
- Added dependency list.
parent 3edbdf7b
Branches
Tags
No related merge requests found
......@@ -8,3 +8,5 @@ build/
dist/
*.egg-info/
__pycache__/
*.log
.tox
recursive-include eb-prune
eb-prune
########
Must specify AWS_DEFAULT_REGION environment variable.
TODO
----
- License.
- Changelog.
- README,
- Testing with different Python versions with tox and flake8.
- Specify number of versions to keep.
......@@ -5,10 +5,10 @@ from __future__ import (absolute_import, division,
from botocore import session
if __name__ == '__main__':
def main():
print('Pruning Elastic Beanstalk versions.')
session = session.get_session()
beanstalk_client = session.create_client('elasticbeanstalk')
aws_session = session.get_session()
beanstalk_client = aws_session.create_client('elasticbeanstalk')
response = beanstalk_client.describe_application_versions()
if response['ResponseMetadata']['HTTPStatusCode'] != 200:
raise RuntimeError('Failed to describe application versions.')
......@@ -34,3 +34,7 @@ if __name__ == '__main__':
print('Deleted version {0} of {1}.'.format(version['VersionLabel'],
version['ApplicationName']))
print('Deleted {0} versions.'.format(len(old_versions)))
if __name__ == '__main__':
main()
[bdist_wheel]
# This flag says that the code is written to work on both Python 2 and Python
# 3. If at all possible, it is good practice to do this. If you cannot, you
# will need to generate wheels for each Python version that you support.
universal=1
......@@ -6,20 +6,24 @@ setup(
version='0.2.0',
description='Pruning of Elastic Beanstalk versions.',
long_description=open('README.rst', 'r').read(),
url='https://www.shore.co.il/cgit/eb-prune',
url='https://www.shore.co.il/git/eb-prune',
author='Nimrod Adar',
author_email='nimrod@shore.co.il',
license='MIT',
classifiers=[
'Development status :: 4 - Beta',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 2.6',
'Intended Audience :: System Administrators',
'Topic :: Utilities',
],
keywords='beanstalk AWS',
packages=find_packages(),
install_requires=['botocore'],
extras_require={
'dev': ['tox', 'flake8'], },
entry_points={
'console_scripts': [
'eb-prune=eb_prune:main'], },
)
tox.ini 0 → 100644
# this file is *not* meant to cover or endorse the use of tox or pytest or
# testing in general,
#
# It's meant to show the use of:
#
# - check-manifest
# confirm items checked into vcs are in your sdist
# - python setup.py check (using the readme_renderer extension)
# confirms your long_description will render correctly on pypi
#
# and also to help confirm pull requests to this project.
[tox]
envlist = py{27,35}
[testenv]
basepython =
py27: python2.7
py35: python3.5
deps =
check-manifest
{py27,py35}: readme_renderer
flake8
commands =
check-manifest --ignore tox.ini,tests*
# py26 doesn't have "setup.py check"
{py27,py35}: python setup.py check -m -r -s
flake8 .
[flake8]
exclude = .tox,*.egg,build,data
select = E,W,F
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment