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