~pyreadline/pyreadline/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# -*- coding: utf-8 -*-

#*****************************************************************************
#       Copyright (C) 2003-2006 Gary Bishop.
#       Copyright (C) 2006  Jorgen Stenarson. <jorgen.stenarson@bostream.nu>
#
#  Distributed under the terms of the BSD License.  The full license is in
#  the file COPYING, distributed as part of this software.
#*****************************************************************************

import os
import sys
import glob

# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
#

extra = {}
_distribute = False

try:
    import setuptools
    setup = setuptools.setup
    _distribute = getattr(setuptools, '_distribute', False)
except ImportError:
    from distutils.core import setup

if sys.version_info >= (3, 0):
    if _distribute == False:
        raise RuntimeError('You must installed `distribute` to setup pyreadline with Python3')

    extra.update(
        use_2to3=True
    )

exec(compile(open('pyreadline/release.py').read(), 'pyreadline/release.py', 'exec'))

try:
    import sphinx
    from sphinx.setup_command import BuildDoc
    cmd_class ={'build_sphinx': BuildDoc}
except ImportError:
    cmd_class = {}

packages = ['pyreadline','pyreadline.clipboard','pyreadline.configuration',
            'pyreadline.console','pyreadline.keysyms','pyreadline.lineeditor',
            'pyreadline.modes','pyreadline.test',
            ]

setup(name=name,
      version          = version,
      description      = description,
      long_description = long_description,
      author           = authors["Jorgen"][0],
      author_email     = authors["Jorgen"][1],
      maintainer       = authors["Jorgen"][0],
      maintainer_email = authors["Jorgen"][1],
      license          = license,
      classifiers      = classifiers,
      url              = url,
      download_url     = download_url,
      platforms        = platforms,
      keywords         = keywords,
      py_modules       = ['readline'],
      packages         = packages,
      package_data     = {'pyreadline':['configuration/*']},
      data_files       = [],
      cmdclass = cmd_class,
      **extra
      )