-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
68 lines (59 loc) · 1.89 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
"""Installation module for XNicer.
For local tests, the recommended way of using this module is
`python setup.py build_ext --use-cython --inplace`
This requires cython in the local path.
"""
import sys
# from distutils.core import setup
# from distutils.extension import Extension
from setuptools import setup
from setuptools.extension import Extension
import numpy as np
with open('README.md', 'r') as fh:
LONG_DESCRIPTION = fh.read()
if '--use-cython' in sys.argv:
USE_CYTHON = True
sys.argv.remove('--use-cython')
else:
USE_CYTHON = False
EXT = '.pyx' if USE_CYTHON else '.c'
EXTENSIONS = [
Extension(
'xnicer.kde.kde',
['xnicer/kde/kde' + EXT]
),
Extension(
'xnicer.xdeconv.em_step',
['xnicer/xdeconv/em_step' + EXT],
include_dirs=[np.get_include()],
extra_compile_args=['-fopenmp'],
extra_link_args=['-fopenmp']
)
]
if USE_CYTHON:
from Cython.Build import cythonize
EXTENSIONS = cythonize(EXTENSIONS)
setup(
name='xnicer',
version='0.2.0',
author='Marco Lombardi',
author_email='marco.lombardi@gmail.com',
description='The XNICER/XNICEST algorithm',
long_description=LONG_DESCRIPTION,
long_description_content_type='text/markdown',
url='https://github.com/astropy/xnicer',
packages=['xnicer', 'xnicer.xdeconv', 'xnicer.kde'], # was setuptools.find_packages()
python_requires='>=3.6',
setup_requires=['numpy', 'matplotlib', 'scipy', 'sklearn', 'astropy',
'nptyping'],
classifiers=[
'Programming Language :: Python :: 3',
'Programming Language :: Cython',
'License:: OSI Approved:: GNU Lesser General Public License v3(LGPLv3)',
'Operating System :: OS Independent',
'Development Status :: 3 - Alpha',
'Topic :: Scientific/Engineering :: Astronomy'
],
keywords='xnicer',
ext_modules=EXTENSIONS
)