Skip to content
Snippets Groups Projects
Commit 34ab9941 authored by nimrod's avatar nimrod
Browse files

Use the docstring as the description.

Both as the package description and the CLI description. Had to
workaround the botocore package missing in some cases (like pre-commit)
so the module can still be imported by setup.py.
parent 2c2a5abc
No related branches found
No related tags found
No related merge requests found
Pipeline #850 passed
...@@ -7,7 +7,12 @@ from __future__ import ( ...@@ -7,7 +7,12 @@ from __future__ import (
unicode_literals, unicode_literals,
) )
from argparse import ArgumentParser from argparse import ArgumentParser
import sys
try:
from botocore import session # pylint: disable=import-error from botocore import session # pylint: disable=import-error
except ImportError:
pass
def prune(versions_to_keep, dry_run): def prune(versions_to_keep, dry_run):
...@@ -57,7 +62,7 @@ def prune(versions_to_keep, dry_run): ...@@ -57,7 +62,7 @@ def prune(versions_to_keep, dry_run):
def main(): def main():
parser = ArgumentParser() parser = ArgumentParser(description=__doc__)
parser.add_argument( parser.add_argument(
"versions_to_keep", help="The number of versions to keep.", type=int "versions_to_keep", help="The number of versions to keep.", type=int
) )
...@@ -72,4 +77,10 @@ def main(): ...@@ -72,4 +77,10 @@ def main():
if __name__ == "__main__": if __name__ == "__main__":
if "session" not in dir():
print(
"Failed to import botocore, is the package installed?",
file=sys.stderr,
)
sys.exit(2)
main() main()
#!/usr/bin/env python #!/usr/bin/env python
from setuptools import setup, find_packages from setuptools import setup, find_packages
from eb_prune import __doc__ as description
setup( setup(
name="eb-prune", name="eb-prune",
version=open("VERSION", "r").read(), version=open("VERSION", "r").read(),
description="Pruning of Elastic Beanstalk versions.", description=description,
long_description=open("README.rst", "r").read(), long_description=open("README.rst", "r").read(),
url="https://www.shore.co.il/git/eb-prune", url="https://www.shore.co.il/git/eb-prune",
author="Nimrod Adar", author="Nimrod Adar",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment