setup.py 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. # -*- coding: utf-8; -*-
  2. # setup.py
  3. # Part of Gajja, a Python test double library.
  4. #
  5. # Copyright © 2008–2016 Ben Finney <ben+python@benfinney.id.au>
  6. #
  7. # This is free software: you may copy, modify, and/or distribute this work
  8. # under the terms of the GNU General Public License as published by the
  9. # Free Software Foundation; version 3 of that license or any later version.
  10. # No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.
  11. """ Distribution setup for Gajja code base. """
  12. from __future__ import (absolute_import, unicode_literals)
  13. import sys
  14. import os
  15. import os.path
  16. import types
  17. import pydoc
  18. import email.utils
  19. from setuptools import (setup, find_packages)
  20. __metaclass__ = type
  21. class SimpleNamespace:
  22. """ A simple attribute-based namespace. """
  23. setup_dir = os.path.dirname(__file__)
  24. changelog = SimpleNamespace()
  25. changelog.package = "gajja"
  26. changelog.version = "0.1.3"
  27. changelog.author = "Ben Finney <ben+python@benfinney.id.au>"
  28. (author_name, author_email) = email.utils.parseaddr(changelog.author)
  29. control_structure = dict()
  30. control_structure['maintainer'] = changelog.author
  31. (maintainer_name, maintainer_email) = email.utils.parseaddr(
  32. control_structure['maintainer'])
  33. control_structure['homepage'] = "https://notabug.org/bignose/python-gajja"
  34. copyright_structure = SimpleNamespace()
  35. license = SimpleNamespace()
  36. license.synopsis = "GPLv3+"
  37. copyright_structure.license = license
  38. main_module = __import__(changelog.package)
  39. (synopsis, long_description) = pydoc.splitdoc(pydoc.getdoc(main_module))
  40. setup(
  41. name=changelog.package,
  42. version=str(changelog.version),
  43. packages=find_packages(exclude=["test"]),
  44. # Setuptools metadata.
  45. maintainer=maintainer_name,
  46. maintainer_email=maintainer_email,
  47. zip_safe=False,
  48. setup_requires=[
  49. "python-debian",
  50. ],
  51. test_suite="unittest2.collector",
  52. tests_require=[
  53. "unittest2 >=0.5.1",
  54. "testtools",
  55. "mock >=1.3",
  56. ],
  57. install_requires=[
  58. "setuptools",
  59. "unittest2 >=0.5.1",
  60. "testtools",
  61. "mock >=1.3",
  62. ],
  63. # PyPI metadata.
  64. author=author_name,
  65. author_email=author_email,
  66. description=synopsis,
  67. license=license.synopsis,
  68. keywords="test double fake mock filesystem subprocess".split(),
  69. url=control_structure['homepage'],
  70. long_description=long_description,
  71. classifiers=[
  72. # Reference: http://pypi.python.org/pypi?%3Aaction=list_classifiers
  73. "Development Status :: 3 - Alpha",
  74. "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
  75. "Operating System :: POSIX",
  76. "Programming Language :: Python :: 2.7",
  77. "Programming Language :: Python :: 3.3",
  78. "Programming Language :: Python :: 3.4",
  79. "Programming Language :: Python :: 3.5",
  80. "Intended Audience :: Developers",
  81. "Topic :: Software Development :: Testing",
  82. ],
  83. )
  84. # Local variables:
  85. # coding: utf-8
  86. # mode: python
  87. # End:
  88. # vim: fileencoding=utf-8 filetype=python :