Toolset to render and manage AWS CloudFormation ( https://pypi.org/project/cloudbender )
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
2.3KB

  1. #!/usr/bin/env python
  2. import io
  3. import os
  4. import re
  5. from setuptools import setup
  6. from setuptools import find_packages
  7. from setuptools.command.test import test as TestCommand
  8. def find_version(filename):
  9. """Uses re to pull out the assigned value to __version__ in filename."""
  10. with io.open(filename, "r", encoding="utf-8") as version_file:
  11. version_match = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]',
  12. version_file.read(), re.M)
  13. if version_match:
  14. return version_match.group(1)
  15. return "0.0-version-unknown"
  16. class PyTest(TestCommand):
  17. """TestCommand subclass to use pytest with setup.py test."""
  18. def finalize_options(self):
  19. """Find our package name and test options to fill out test_args."""
  20. TestCommand.finalize_options(self)
  21. self.test_args = ['-rx', '--cov', 'cloudbender',
  22. '--cov-report', 'term-missing']
  23. self.test_suite = True
  24. def run_tests(self):
  25. """Taken from http://pytest.org/latest/goodpractises.html."""
  26. # have to import here, outside the eggs aren't loaded
  27. import pytest
  28. errno = pytest.main(self.test_args)
  29. raise SystemExit(errno)
  30. if os.path.isfile("README.md"):
  31. with io.open("README.md", encoding="utf-8") as opendescr:
  32. long_description = opendescr.read()
  33. else:
  34. long_description = __doc__
  35. setup(
  36. name='cloudbender',
  37. version=find_version("cloudbender/__init__.py"),
  38. description='Toolset to render and manage AWS Cloudformation',
  39. long_description=long_description,
  40. long_description_content_type="text/markdown",
  41. author='Stefan Reimer',
  42. author_email='stefan@zero-downtime.net',
  43. url='https://git.zero-downtime.net/ZeroDownTime/CloudBender',
  44. packages=find_packages(),
  45. package_data={ 'cloudbender': ['templates/*.md'], },
  46. include_package_data=True,
  47. entry_points={'console_scripts': [ "cloudbender = cloudbender.cli:cli" ]},
  48. install_requires=['boto3', 'Jinja2', 'oyaml', 'click', 'cfn-lint', 'pyminifier'],
  49. tests_require=["pytest-cov", "moto", "mock", 'pytest'],
  50. cmdclass={"test": PyTest},
  51. classifiers=[
  52. "Development Status :: 4 - Beta",
  53. "Environment :: Console",
  54. "Operating System :: POSIX",
  55. "Programming Language :: Python",
  56. "License :: OSI Approved :: GNU Affero General Public License v3"
  57. ])