forked from scikit-beam/scikit-beam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
65 lines (54 loc) · 2.2 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
#!/usr/bin/env python
import setuptools
from distutils.core import setup, Extension
import versioneer
import numpy as np
import os
import sys
from Cython.Build import cythonize
# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()
def c_ext():
if os.name == 'nt':
# we are on windows. Do not compile the extension. Tons of errors are
# spit out when we compile on AppVeyor.
# https://gist.github.com/ericdill/bdc86eb81e338ca4624b
return []
# compile for MacOS without openmp
if sys.platform == 'darwin':
return [Extension('skbeam.ext.ctrans', ['src/ctrans.c'])]
# compile the extension on Linux.
return [Extension('skbeam.ext.ctrans', ['src/ctrans.c'],
extra_compile_args=['-fopenmp'],
extra_link_args=['-lgomp'])]
def cython_ext():
return cythonize("**/*.pyx")
setup(
name='scikit-beam',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
author='Brookhaven National Lab',
description="Data analysis tools for X-ray science",
packages=setuptools.find_packages(exclude=['doc']),
include_dirs=[np.get_include()],
package_data={'skbeam.core.constants': ['data/*.dat']},
install_requires=['six', 'numpy'], # essential deps only
ext_modules=c_ext() + cython_ext(),
url='http://github.com/scikit-beam/scikit-beam',
keywords='Xray Analysis',
license='BSD',
classifiers=['Development Status :: 3 - Alpha',
"License :: OSI Approved :: BSD License",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.4",
"Topic :: Scientific/Engineering :: Physics",
"Topic :: Scientific/Engineering :: Chemistry",
"Topic :: Software Development :: Libraries",
"Intended Audience :: Science/Research",
"Intended Audience :: Developers",
],
)