-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathsetup.py
67 lines (57 loc) · 1.97 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
import sys
import numpy
import versioneer
from Cython.Build import cythonize
from setuptools import setup
from setuptools.command.build_ext import build_ext
from setuptools.extension import Extension
class _build_ext(build_ext):
"""build_ext command for use when numpy and Cython are needed.
https://stackoverflow.com/a/42163080/8083313
"""
def run(self):
# Cythonize the extension (and path the `_needs_stub` attribute,
# which is not set by Cython but required by `setuptools`)
self.extensions = cythonize(self.extensions, force=self.force)
for extension in self.extensions:
extension._needs_stub = False
# Call original build_ext command
build_ext.run(self)
doc = open("README.md").read()
cfisher_ext = Extension(
"fisher.cfisher",
["src/cfisher.pyx"],
extra_compile_args=["-O3"],
include_dirs=[numpy.get_include()],
)
cmdclass = {"build_ext": _build_ext}
cmdclass.update(versioneer.get_cmdclass())
setup_options = dict(
name="fisher",
version=versioneer.get_version(),
description="Fast Fisher's Exact Test",
url="http://github.com/brentp/fishers_exact_test",
long_description=doc,
long_description_content_type="text/markdown",
author="Haibao Tang, Brent Pedersen",
author_email="[email protected]",
ext_modules=[cfisher_ext],
cmdclass=cmdclass,
install_requires=['numpy'],
setup_requires=["numpy", "cython", "versioneer"],
keywords="statistics cython",
license="BSD",
packages=["fisher"],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Scientific/Engineering",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3",
],
)
setup(**setup_options)