-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
71 lines (60 loc) · 2.22 KB
/
setup.py
File metadata and controls
71 lines (60 loc) · 2.22 KB
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
from setuptools import setup
#from setuptools.extension import Extension
import numpy
import os
import sys
import subprocess
#from distutils.core import setup
from distutils.extension import Extension
from Cython.Build import cythonize
#from Cython.Distutils import build_ext
args = sys.argv[1:]
# Make a `cleanall` rule to get rid of intermediate and library files
if "cleanall" in args:
print("Deleting cython files...")
# Just in case the build directory was created by accident,
# note that shell=True should be OK here because the command is constant.
subprocess.Popen("rm -rf onezone_cython.egg-info",shell=True,executable="/bin/bash")
subprocess.Popen("rm -rf onezone.egg-info",shell=True,executable="/bin/bash")
subprocess.Popen("rm -rf dist",shell=True,executable="/bin/bash")
for p in ['./','./onezone/cython_ext/']:
subprocess.Popen("rm -rf " + p + "build", shell=True, executable="/bin/bash")
subprocess.Popen("rm -rf " + p + "*.c", shell=True, executable="/bin/bash")
subprocess.Popen("rm -rf " + p + "*.so", shell=True, executable="/bin/bash")
sys.exit()
cython_extensions = [
Extension(
"onezone.cython_ext.sample_imf",
["onezone/cython_ext/sample_imf.pyx"],
include_dirs = [numpy.get_include()]
#extra_compile_args=["-g"],
# extra_link_args=["-g"],
),
Extension(
"onezone.cython_ext.cython_star",
["onezone/cython_ext/cython_star.pyx"],
include_dirs = [numpy.get_include()],
# extra_compile_args=["-g"],
# extra_link_args=["-g"],
)
]
setup(
name="onezone",
version="0.1",
author="Andrew Emerick",
author_email="aemerick11@gmail.com",
url="https://github.com/aemerick/onezone",
packages = [
'onezone',
'onezone.analysis',
'onezone.plots',
'onezone.cython_ext'],
install_requires=[
'numpy',
'scipy',
'cython',
'matplotlib',
'h5py'], # and others ... need to finish
ext_modules = cythonize(cython_extensions) # cythonize("onezone/cython_ext/sample_imf.pyx"),
#cython_extensions
)