forked from man-group/arctic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
132 lines (119 loc) · 5.16 KB
/
setup.py
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#
# Copyright (C) 2015 Man AHL
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA
import logging
from setuptools import setup, Extension
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
# Convert Markdown to RST for PyPI
# http://stackoverflow.com/a/26737672
try:
import pypandoc
long_description = pypandoc.convert('README.md', 'rst')
changelog = pypandoc.convert('CHANGES.md', 'rst')
except (IOError, ImportError, OSError):
long_description = open('README.md').read()
changelog = open('CHANGES.md').read()
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
logging.basicConfig(format='%(asctime)s %(levelname)s %(name)s %(message)s', level='DEBUG')
# import here, cause outside the eggs aren't loaded
import pytest
args = [self.pytest_args] if isinstance(self.pytest_args, basestring) else list(self.pytest_args)
args.extend(['--cov', 'arctic',
'--cov-report', 'xml',
'--cov-report', 'html',
'--junitxml', 'junit.xml',
])
errno = pytest.main(args)
sys.exit(errno)
# setuptools_cython: setuptools DWIM monkey-patch madness
# http://mail.python.org/pipermail/distutils-sig/2007-September/thread.html#8204
import sys
if 'setuptools.extension' in sys.modules:
m = sys.modules['setuptools.extension']
m.Extension.__dict__ = m._Extension.__dict__
# Cython lz4
compress = Extension('arctic._compress',
sources=["src/_compress.pyx", "src/lz4.c", "src/lz4hc.c"],
extra_compile_args=['-fopenmp'],
extra_link_args=['-fopenmp'])
setup(
name="arctic",
version="1.8.0",
author="Man AHL Technology",
author_email="[email protected]",
description=("AHL Research Versioned TimeSeries and Tick store"),
license="GPL",
keywords=["ahl", "keyvalue", "tickstore", "mongo", "timeseries", ],
url="https://github.com/manahl/arctic",
packages=find_packages(),
long_description='\n'.join((long_description, changelog)),
cmdclass={'test': PyTest},
ext_modules=[compress],
setup_requires=["setuptools_cython",
"Cython",
"numpy",
],
install_requires=["decorator",
"enum34",
"lz4",
"mockextras",
"pandas",
"pymongo>=3.0",
"python-dateutil",
"pytz",
"tzlocal",
],
tests_require=["mock<=1.0.1",
"mockextras",
"pytest",
"pytest-cov",
"pytest-dbfixtures",
"pytest-timeout",
"pytest-xdist",
],
entry_points={'console_scripts': [
'arctic_init_library = arctic.scripts.arctic_init_library:main',
'arctic_list_libraries = arctic.scripts.arctic_list_libraries:main',
'arctic_delete_library = arctic.scripts.arctic_delete_library:main',
'arctic_enable_sharding = arctic.scripts.arctic_enable_sharding:main',
'arctic_copy_data = arctic.scripts.arctic_copy_data:main',
'arctic_create_user = arctic.scripts.arctic_create_user:main',
'arctic_prune_versions = arctic.scripts.arctic_prune_versions:main',
'arctic_fsck = arctic.scripts.arctic_fsck:main',
]
},
classifiers=[
"Development Status :: 4 - Beta",
"License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Cython",
"Topic :: Database",
"Topic :: Database :: Front-Ends",
"Topic :: Software Development :: Libraries",
],
)