summaryrefslogtreecommitdiff
path: root/setup.py
blob: 35d9921aa2b8fa556721361ffd754c24d2abb075 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#!/usr/bin/env python
import subprocess
import sys
from os import getenv
from os.path import dirname, join

import setuptools
import setuptools.command.develop
import setuptools.command.test


class SetupDevelop(setuptools.command.develop.develop):
    """Docstring is overwritten."""

    def run(self):
        """
        Prepare environment for development.

        - Ensures a virtualenv environmnt is used.
        - Ensures tox, ipython, wheel is installed for convenience and testing.
        - Call super()'s run method.
        """
        assert getenv('VIRTUAL_ENV'), 'You should be in a virtualenv'
        subprocess.check_call(('pip', 'install', 'tox', 'ipython', 'wheel'))

        # Call super() (except develop is an old-style class, so we must call
        # directly). The effect is that the development egg-link is installed.
        setuptools.command.develop.develop.run(self)

SetupDevelop.__doc__ = setuptools.command.develop.develop.__doc__


class SetupTest(setuptools.command.test.test):
    """Docstring is overwritten."""

    def run(self):
        """Spawn tox."""
        self.spawn(('tox',))

SetupTest.__doc__ = setuptools.command.test.test.__doc__

kwargs = {
    'install_requires': [
        'wcwidth>=0.1.4',
        'six>=1.9.0',
    ]
}

if sys.version_info < (2, 7):
    # we make use of collections.ordereddict: for python 2.6 we require the
    # assistance of the 'orderddict' module which backports the same.
    kwargs['install_requires'].extend(['ordereddict>=1.1'])

setuptools.setup(
    name='blessings',
    version='1.9.5',
    description=('A thin, practical wrapper around terminal coloring, '
                 'styling, positioning, and keyboard input.'),
    long_description=open(join(dirname(__file__),
                               'docs', 'intro.rst')).read(),
    author='Erik Rose, Jeff Quast',
    author_email='erikrose@grinchcentral.com',
    license='MIT',
    packages=['blessings', 'blessings.tests'],
    url='https://github.com/erikrose/blessings',
    include_package_data=True,
    test_suite='blessings.tests',
    zip_safe=True,
    classifiers=[
        'Intended Audience :: Developers',
        'Natural Language :: English',
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Environment :: Console :: Curses',
        'License :: OSI Approved :: MIT License',
        'Operating System :: POSIX',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.2',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Topic :: Software Development :: Libraries',
        'Topic :: Software Development :: User Interfaces',
        'Topic :: Terminals'
    ],
    keywords=['terminal', 'sequences', 'tty', 'curses', 'ncurses',
              'formatting', 'style', 'color', 'console', 'keyboard',
              'ansi', 'xterm'],
    cmdclass={'develop': SetupDevelop,
              'test': SetupTest},
    **kwargs
)