setup.py 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. # -*- coding: utf-8 -*-
  2. #
  3. # Copyright (C) 2018 by Gregor Giesen
  4. #
  5. # This file is part of Ansible Simple API.
  6. #
  7. # Ansible Simple API is free software: you can redistribute it and/or
  8. # modify it under the terms of the GNU General Public License as published
  9. # by the Free Software Foundation, either version 3 of the License,
  10. # or (at your option) any later version.
  11. #
  12. # Ansible Simple API is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with Ansible Simple API. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. # Always prefer setuptools over distutils
  21. from setuptools import setup, find_packages
  22. # To use a consistent encoding
  23. from codecs import open
  24. import re
  25. import os.path
  26. here = os.path.abspath(os.path.dirname(__file__))
  27. version_file = os.path.join(here, 'lib', 'ansible_simple_api', 'version.py')
  28. with open(version_file, 'rt') as fp:
  29. re_version = re.compile(
  30. r"""^__version__[ ]*=[ ]*["']{1,3}(.+)["']{1,3}$""")
  31. for line in fp:
  32. r = re_version.match(line)
  33. if r is not None:
  34. version = r.group(1)
  35. break
  36. else:
  37. raise RuntimeError("Cannot find version string in %s" % version_file)
  38. # Get the long description from the README file
  39. with open(os.path.join(here, 'README.rst'), encoding='utf-8') as f:
  40. long_description = f.read()
  41. setup(
  42. name='ansible-simple-api',
  43. # Versions should comply with PEP440. For a discussion on single-sourcing
  44. # the version across setup.py and the project code, see
  45. # https://packaging.python.org/en/latest/single_source_version.html
  46. version=version,
  47. description="Ansible Simple API - simple access to Ansible's API",
  48. long_description=long_description,
  49. # The project's main homepage.
  50. url='https://github.com/zaehlwerk/ansible-simple_api',
  51. # Author details
  52. author='Gregor Giesen',
  53. author_email='giesen@zaehlwerk.net',
  54. # Choose your license
  55. license="GPLv3",
  56. # See https://pypi.python.org/pypi?%3Aaction=list_classifiers
  57. classifiers=[
  58. 'Development Status :: 3 - Alpha',
  59. 'Intended Audience :: Developers',
  60. 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
  61. 'Programming Language :: Python',
  62. 'Programming Language :: Python :: 2.7',
  63. 'Programming Language :: Python :: 3.5',
  64. 'Programming Language :: Python :: 3.6',
  65. ],
  66. # What does your project relate to?
  67. keywords='ansible',
  68. # You can just specify the packages manually here if your project is
  69. # simple. Or you can use find_packages().
  70. package_dir={'': 'lib'},
  71. packages=find_packages('lib', exclude=['tests']),
  72. # List run-time dependencies here. These will be installed by pip when
  73. # your project is installed. For an analysis of "install_requires" vs pip's
  74. # requirements files see:
  75. # https://packaging.python.org/en/latest/requirements.html
  76. install_requires=[
  77. 'ansible>=2.4'
  78. ],
  79. # List additional groups of dependencies here (e.g. development
  80. # dependencies). You can install these using the following syntax,
  81. # for example:
  82. # $ pip install -e .[dev,test]
  83. extras_require={
  84. 'test': ['pytest',
  85. 'pytest-cov',
  86. 'pytest-flakes',
  87. 'pytest-mock',
  88. 'pytest-pep8',
  89. 'pytest-runner'],
  90. },
  91. # If there are data files included in your packages that need to be
  92. # installed, specify them here. If using Python 2.6 or less, then these
  93. # have to be included in MANIFEST.in as well.
  94. package_data={},
  95. setup_requires=[],
  96. tests_require=['pytest',
  97. 'pytest-cov',
  98. 'pytest-flakes',
  99. 'pytest-pep8',
  100. 'pytest-mock'],
  101. # To provide executable scripts, use entry points in preference to the
  102. # "scripts" keyword. Entry points provide cross-platform support and allow
  103. # pip to create the appropriate form of executable for the target platform.
  104. entry_points={},
  105. )