-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathsetup.py
122 lines (106 loc) · 3.62 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
########################################################################
# File based on https://github.com/Blosc/bcolz
########################################################################
#
# License: BSD
# Created: October 5, 2015
# Author: Carst Vaartjes - [email protected]
#
########################################################################
from __future__ import absolute_import
import codecs
import os
from setuptools import setup, Extension, find_packages
from os.path import abspath
from sys import version_info as v
from Cython.Build import cythonize, build_ext
import numpy
# Check this Python version is supported
if any([v < (2, 6), (3,) < v < (3, 5)]):
raise Exception("Unsupported Python version %d.%d. Requires Python >= 2.7 "
"or >= 3.5." % v[:2])
HERE = os.path.abspath(os.path.dirname(__file__))
def read(*parts):
"""
Build an absolute path from *parts* and and return the contents of the
resulting file. Assume UTF-8 encoding.
"""
with codecs.open(os.path.join(HERE, *parts), "rb", "utf-8") as f:
return f.read()
def get_version():
with codecs.open(abspath('VERSION'), "r", "utf-8") as f:
return f.readline().rstrip('\n')
# Sources & libraries
sources = ['bquery/ctable_ext.pyx']
optional_libs = ['numexpr>=1.4.1']
install_requires = [
'pip>=8.1.2',
'setuptools>=27.3',
'cython>=0.29.2',
'bcolz>=1.2.1'
]
setup_requires = []
tests_requires = ['pytest', 'nose']
if v < (3,):
tests_requires.extend(['unittest2', 'mock'])
install_requires.extend(['numpy<=1.16.5'])
setup_requires.extend(['numpy<=1.16.5'])
else:
install_requires.extend(['numpy'])
setup_requires.extend(['numpy'])
extras_requires = [
'numexpr>=1.4.1'
]
extensions = [
Extension("bquery.ctable_ext", ["bquery/ctable_ext.pyx"],
include_dirs=[abspath('bquery'), numpy.get_include()],
libraries=[],
library_dirs=[])
]
ext_modules = cythonize(extensions)
package_data = {'bquery': ['ctable_ext.pxd']}
classifiers = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Programming Language :: Python',
'Topic :: Software Development :: Libraries :: Python Modules',
'Operating System :: Microsoft :: Windows',
'Operating System :: Unix',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
]
setup(
name="bquery",
version=get_version(),
description='A query and aggregation framework for Bcolz',
long_description=read("README.md"),
long_description_content_type='text/markdown',
classifiers=classifiers,
author='Carst Vaartjes',
author_email='[email protected]',
maintainer='Carst Vaartjes',
maintainer_email='[email protected]',
url='https://github.com/visualfabriq/b4query',
license='MIT',
platforms=['any'],
ext_modules=ext_modules,
cmdclass={'build_ext': build_ext},
install_requires=install_requires,
setup_requires=setup_requires,
tests_require=tests_requires,
extras_require=dict(
optional=extras_requires,
test=tests_requires
),
packages=find_packages(),
package_data=package_data,
include_package_data=True,
zip_safe=True
)