forked from feerci/feerci
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
96 lines (85 loc) · 2.38 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
#!/usr/bin/env python
import logging
import sys
import pprint
import platform
from setuptools import setup, find_packages
from setuptools.extension import Extension
# Set up the logging environment
logging.basicConfig()
log = logging.getLogger()
# Handle the -W all flag
if 'all' in sys.warnoptions:
log.level = logging.DEBUG
with open('VERSION.txt', 'r') as f:
version = f.read()
# Use Cython if available
try:
from Cython.Build import cythonize
except:
log.critical(
'Cython.Build.cythonize not found. '
'Cython is required to build from a repo.')
sys.exit(1)
# Use README.rst as the long description
with open('README.rst') as f:
readme = f.read()
# Extension options
include_dirs = []
try:
import numpy
include_dirs.append(numpy.get_include())
except ImportError:
log.critical('Numpy and its headers are required to run setup(). Exiting')
sys.exit(1)
opts = dict(
include_dirs=include_dirs,
)
log.debug('opts:\n%s', pprint.pformat(opts))
pyx_path = 'feerci.pyx'
if 'test' in sys.argv and platform.python_implementation() == 'CPython':
from Cython.Build import cythonize
ext_modules = cythonize(Extension(
"feerci",
[pyx_path],
define_macros=[('CYTHON_TRACE', '1')],**opts
), compiler_directives={
'linetrace': True,
'binding': True
})
else:
from Cython.Build import cythonize, build_ext
ext_modules = cythonize(Extension(
"feerci",
[pyx_path],
extra_compile_args=['-O3'],**opts
))
# Dependencies
install_requires = [
'numpy>=1.7',
'Cython',
]
python_requires = '>=3.5'
setup_args = dict(
name='feerci',
version=version,
description='FEERCI: A python package for EER confidence intervals ',
long_description=readme,
url='https://github.com/feerci/feerci',
# author='FEERCI Dev',
# author_email='[email protected]',
# license='MIT',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.5',
],
keywords=['EER', 'Confidence Interval', 'feerci','feer','biometrics'],
ext_modules=ext_modules,
install_requires=install_requires,
packages=find_packages(exclude='tests'),
tests_require=['cython', 'pytest', 'coverage'],
test_suite='tests'
)
setup(**setup_args)