forked from spacetelescope/calcos
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·87 lines (79 loc) · 2.12 KB
/
setup.py
File metadata and controls
executable file
·87 lines (79 loc) · 2.12 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env python
import os
from fnmatch import fnmatch
from setuptools import setup, find_packages, Extension
from numpy import get_include as numpy_includes
def c_sources(parent):
sources = []
for root, _, files in os.walk(parent):
for f in files:
fn = os.path.join(root, f)
if fnmatch(fn, '*.c'):
sources.append(fn)
return sources
def c_includes(parent, depth=1):
includes = [parent]
for root, dirs, _ in os.walk(parent):
for d in dirs:
dn = os.path.join(root, d)
if len(dn.split(os.sep)) - 1 > depth:
continue
includes.append(dn)
return includes
PACKAGENAME = 'calcos'
SOURCES = c_sources('src')
INCLUDES = c_includes('src') + [numpy_includes()]
setup(
name=PACKAGENAME,
use_scm_version={'write_to': 'calcos/version.py'},
setup_requires=['setuptools_scm'],
install_requires=[
'astropy',
'numpy',
'scipy',
'stsci.tools',
],
extras_require={
'docs': [
'sphinx',
],
'test': [
'ci_watson',
'pytest',
'pytest-cov',
'codecov',
],
},
packages=find_packages(),
package_data={
PACKAGENAME: [
'pars/*',
'*.help',
],
},
ext_modules=[
Extension(
PACKAGENAME + '.ccos',
sources=SOURCES,
include_dirs=INCLUDES,
),
],
entry_points={
'console_scripts': {
'calcos = calcos:main',
},
},
author='Phil Hodge, Robert Jedrzejewski',
author_email='help@stsci.edu',
description='Calibration software for COS (Cosmic Origins Spectrograph)',
url='https://github.com/spacetelescope/calcos',
license='BSD',
classifiers=[
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python :: 3',
'Programming Language :: C',
'Topic :: Software Development :: Libraries :: Python Modules',
],
)