setup.py 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. import os
  2. import sys
  3. import setuptools
  4. from distutils.core import setup
  5. if sys.version_info[:2] < (2, 7):
  6. required = ['ordereddict']
  7. else:
  8. required = []
  9. long_desc = '''\
  10. enum --- support for enumerations
  11. ========================================
  12. An enumeration is a set of symbolic names (members) bound to unique, constant
  13. values. Within an enumeration, the members can be compared by identity, and
  14. the enumeration itself can be iterated over.
  15. from enum import Enum
  16. class Fruit(Enum):
  17. apple = 1
  18. banana = 2
  19. orange = 3
  20. list(Fruit)
  21. # [<Fruit.apple: 1>, <Fruit.banana: 2>, <Fruit.orange: 3>]
  22. len(Fruit)
  23. # 3
  24. Fruit.banana
  25. # <Fruit.banana: 2>
  26. Fruit['banana']
  27. # <Fruit.banana: 2>
  28. Fruit(2)
  29. # <Fruit.banana: 2>
  30. Fruit.banana is Fruit['banana'] is Fruit(2)
  31. # True
  32. Fruit.banana.name
  33. # 'banana'
  34. Fruit.banana.value
  35. # 2
  36. Repository and Issue Tracker at https://bitbucket.org/stoneleaf/enum34.
  37. '''
  38. py2_only = ()
  39. py3_only = ()
  40. make = [
  41. 'rst2pdf enum/doc/enum.rst --output=enum/doc/enum.pdf',
  42. ]
  43. data = dict(
  44. name='enum34',
  45. version='1.1.6',
  46. url='https://bitbucket.org/stoneleaf/enum34',
  47. packages=['enum'],
  48. package_data={
  49. 'enum' : [
  50. 'LICENSE',
  51. 'README',
  52. 'doc/enum.rst',
  53. 'doc/enum.pdf',
  54. 'test.py',
  55. ]
  56. },
  57. license='BSD License',
  58. description='Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4',
  59. long_description=long_desc,
  60. provides=['enum'],
  61. install_requires=required,
  62. author='Ethan Furman',
  63. author_email='ethan@stoneleaf.us',
  64. classifiers=[
  65. 'Development Status :: 5 - Production/Stable',
  66. 'Intended Audience :: Developers',
  67. 'License :: OSI Approved :: BSD License',
  68. 'Programming Language :: Python',
  69. 'Topic :: Software Development',
  70. 'Programming Language :: Python :: 2.4',
  71. 'Programming Language :: Python :: 2.5',
  72. 'Programming Language :: Python :: 2.6',
  73. 'Programming Language :: Python :: 2.7',
  74. 'Programming Language :: Python :: 3.3',
  75. 'Programming Language :: Python :: 3.4',
  76. 'Programming Language :: Python :: 3.5',
  77. ],
  78. )
  79. if __name__ == '__main__':
  80. setup(**data)