-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·132 lines (120 loc) · 4.07 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env python
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import absolute_import, division, print_function
#
# Standard imports
#
import sys
import glob, os
import pdb
#from distutils.extension import Extension
#
# setuptools' sdist command ignores MANIFEST.in
#
#from distutils.command.sdist import sdist as DistutilsSdist
from setuptools import setup
#
# DESI support code.
#
#from desiutil.setup import DesiTest, DesiVersion, get_version
# Check dependencies
#if sys.argv[1] != 'egg_info':
# from pypit import archeck
# archeck.version_check()
#
# Begin setup
#
setup_keywords = dict()
#
# THESE SETTINGS NEED TO BE CHANGED FOR EVERY PRODUCT.
#
setup_keywords['name'] = 'arclines'
setup_keywords['description'] = 'ArcLine Database'
setup_keywords['author'] = 'PYPIT Collaboration'
setup_keywords['author_email'] = '[email protected]'
setup_keywords['license'] = 'BSD'
setup_keywords['url'] = 'https://github.com/pypit/arclines'
#
# END OF SETTINGS THAT NEED TO BE CHANGED.
#
setup_keywords['version'] = '0.8.dev0' #get_version(setup_keywords['name'])
#
# Use README.rst as long_description.
#
setup_keywords['long_description'] = ''
if os.path.exists('README.md'):
with open('README.md') as readme:
setup_keywords['long_description'] = readme.read()
#
# Set other keywords for the setup function. These are automated, & should
# be left alone unless you are an expert.
#
# Treat everything in bin/ except *.rst as a script to be installed.
#
if os.path.isdir('bin'):
setup_keywords['scripts'] = [fname for fname in glob.glob(os.path.join('bin', '*'))
if not os.path.basename(fname).endswith('.rst')]
setup_keywords['provides'] = [setup_keywords['name']]
setup_keywords['requires'] = ['Python (>2.7.0)']
# setup_keywords['install_requires'] = ['Python (>2.7.0)']
setup_keywords['zip_safe'] = False
#setup_keywords['use_2to3'] = False
setup_keywords['packages'] = ['arclines'] #find_packages('pypit')
#setup_keywords['package_dir'] = {'':''}
#setup_keywords['cmdclass'] = {'version': DesiVersion, 'test': DesiTest, 'sdist': DistutilsSdist}
#setup_keywords['test_suite']='{name}.tests.{name}_test_suite.{name}_test_suite'.format(**setup_keywords)
setup_keywords['setup_requires']=['pytest-runner']
setup_keywords['tests_require']=['pytest']
# Cython
import numpy, os
#from Cython.Distutils import build_ext
#from Cython.Build import cythonize
from distutils.extension import Extension
'''
include_gsl_dir = os.getenv('GSL_PATH')+'/include/'
lib_gsl_dir = os.getenv('GSL_PATH')+'/lib/'
pyx_files = glob.glob('arclines/holy/*.pyx')
setup_keywords['ext_modules']=[]
for pyx_file in pyx_files:
pyx_split = pyx_file.split('.')
pyx_split2 = pyx_split[0].split('/')
# Generate Extension
#ext = Extension(pyx_split2[1], [pyx_file],
ext = Extension('arclines.holy.'+pyx_split2[1], [pyx_file],
include_dirs=[numpy.get_include(),
include_gsl_dir],
library_dirs=[lib_gsl_dir],
libraries=["gsl","gslcblas"]
)
# Append
setup_keywords['ext_modules'].append(ext)
#for pyx_file in pyx_files:
# pyx_split = pyx_file.split('/')
# ext = cythonize(pyx_split[1])
# setup_keywords['ext_modules'].append(ext)
'''
#setup_keywords['cmdclass']={'build_ext': build_ext}
# Autogenerate command-line scripts.
#
# setup_keywords['entry_points'] = {'console_scripts':['desiInstall = desiutil.install.main:main']}
#
# Add internal data directories.
#
data_files = []
# walk through the data directory, adding all files
data_generator = os.walk('arclines/data')
for path, directories, files in data_generator:
for f in files:
data_path = '/'.join(path.split('/')[1:])
data_files.append(data_path + '/' + f)
# add pipeline and spectrograph settings
#settings = glob.glob('arclines/settings/settings.*')
#settings = ['/'.join(path.split('/')[1:]) for path in settings]
#data_files.extend(settings)
setup_keywords['package_data'] = {'arclines': data_files,
'': ['*.rst', '*.txt']}
setup_keywords['include_package_data'] = True
#
# Run setup command.
#
setup(**setup_keywords)