setup.py 3.38 KB
Newer Older
1 2 3
"""Distributed, redundant and transactional storage for ZODB
"""

4 5
from setuptools import setup, find_packages
import os
6

7 8 9 10 11
classifiers = """\
Framework :: ZODB
Intended Audience :: Developers
License :: OSI Approved :: GNU General Public License (GPL)
Operating System :: POSIX :: Linux
12
Programming Language :: Python :: 2.7
13 14 15 16
Topic :: Database
Topic :: Software Development :: Libraries :: Python Modules
"""

17 18
mock = 'neo/tests/mock.py'
if not os.path.exists(mock):
19
    import cStringIO, hashlib, subprocess, urllib, zipfile
20 21 22 23 24 25 26
    x = 'pythonmock-0.1.0.zip'
    try:
        x = subprocess.check_output(('git', 'cat-file', 'blob', x))
    except (OSError, subprocess.CalledProcessError):
        x = urllib.urlopen(
            'http://downloads.sf.net/sourceforge/python-mock/' + x).read()
    mock_py = zipfile.ZipFile(cStringIO.StringIO(x)).read('mock.py')
27 28 29
    if (hashlib.sha256(mock_py).hexdigest() !=
        'c6ed26e4312ed82160016637a9b6f8baa71cf31a67c555d44045a1ef1d60d1bc'):
        raise EnvironmentError("SHA checksum mismatch downloading 'mock.py'")
30
    open(mock, 'w').write(mock_py)
31

32
zodb_require = ['ZODB3>=3.10dev']
33

34
extras_require = {
35
    'admin': [],
36
    'client': zodb_require,
37 38
    'ctl': [],
    'master': [],
39
    'storage-sqlite': [],
40
    'storage-mysqldb': ['mysqlclient'],
41
    'storage-importer': zodb_require,
42
}
43
extras_require['tests'] = ['coverage', 'zope.testing', 'psutil>=2',
44 45
    'neoppod[%s]' % ', '.join(extras_require)]

46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
try:
    from docutils.core import publish_string
except ImportError:
    pass
else:
    from distutils.dist import DistributionMetadata
    _get_long_description = DistributionMetadata.get_long_description.im_func
    def get_long_description(self):
        r = _get_long_description(self)
        DistributionMetadata.get_long_description = _get_long_description
        publish_string(r, enable_exit_status=True, settings_overrides={
            'exit_status_level': 0})
        return r
    DistributionMetadata.get_long_description = get_long_description

61 62
setup(
    name = 'neoppod',
63
    version = '1.8.1',
64
    description = __doc__.strip(),
65
    author = 'Nexedi SA',
66
    author_email = 'neo-dev@erp5.org',
Julien Muchembled's avatar
Julien Muchembled committed
67
    url = 'https://neo.nexedi.com/',
68
    license = 'GPL 2+',
69
    platforms = ["any"],
70
    classifiers=classifiers.splitlines(),
71 72
    long_description = ".. contents::\n\n" + open('README.rst').read()
                     + "\n" + open('CHANGELOG.rst').read(),
73
    packages = find_packages(),
74
    entry_points = {
Vincent Pelletier's avatar
Vincent Pelletier committed
75
        'console_scripts': [
76 77
            # XXX: we'd like not to generate scripts for unwanted features
            # (eg. we don't want neotestrunner if nothing depends on tests)
Vincent Pelletier's avatar
Vincent Pelletier committed
78
            'neoadmin=neo.scripts.neoadmin:main',
79
            'neoctl=neo.scripts.neoctl:main',
80
            'neolog=neo.scripts.neolog:main',
81
            'neomaster=neo.scripts.neomaster:main',
82
            'neomigrate=neo.scripts.neomigrate:main',
83 84
            'neostorage=neo.scripts.neostorage:main',
            'neotestrunner=neo.scripts.runner:main',
85
            'neosimple=neo.scripts.simple:main',
86
            'stat_zodb=neo.tests.stat_zodb:main',
Vincent Pelletier's avatar
Vincent Pelletier committed
87
        ],
88 89 90
        'zodburi.resolvers': [
            'neo = neo.client.zodburi:resolve_uri [client]',
        ],
Vincent Pelletier's avatar
Vincent Pelletier committed
91
    },
92 93 94
    install_requires = [
        'python-dateutil', # neolog --from
        ],
95
    extras_require = extras_require,
96
    package_data = {
97
        'neo.client': [
98 99 100
            'component.xml',
        ],
    },
101
    zip_safe = True,
102
)