-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
70 lines (59 loc) · 2.31 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
import os
from distutils.command.build_ext import build_ext as _build_ext_distutils
from setuptools import find_packages, setup, Extension
class CTypesExtension(Extension): pass
class _build_ext_ctypes(_build_ext_distutils):
def build_extension(self, ext):
self._ctypes = isinstance(ext, CTypesExtension)
return super().build_extension(ext)
def get_export_symbols(self, ext):
if self._ctypes:
return ext.export_symbols
return super().get_export_symbols(ext)
def get_ext_filename(self, ext_name):
if self._ctypes:
if os.name == 'nt':
return ext_name + '.dll'
else:
return ext_name + '.so'
return super().get_ext_filename(ext_name)
with open('README.rst') as f:
readme = f.read()
setup(
name='pytdigest',
version='0.1.4',
description='Python package for *fast* TDigest calculation.',
long_description=readme,
#py_modules=['pytdigest'],
ext_modules=[CTypesExtension(
name=os.path.join('pytdigest', 'tdigest'),
sources=['pytdigest/tdigest.c'],
)],
cmdclass={'build_ext': _build_ext_ctypes},
author='Tomas Protivinsky',
author_email='[email protected]',
url='https://github.com/protivinsky/pytdigest',
keywords='tdigest, distribution, statistics',
python_requires=">=3.7, <4",
install_requires=['numpy>=1.19.0', 'pandas>=1.1.0'],
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
"Development Status :: 3 - Alpha",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
#package_dir={"": "pytdigest"},
packages=find_packages(where="."), # Required
project_urls={ # Optional
"Homepage": "https://github.com/protivinsky/pytdigest",
"Documentation": "https://protivinsky.github.io/pytdigest",
},
)