forked from spacetelescope/nirspec_pipe_testing_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
88 lines (79 loc) · 2.38 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
import os
from setuptools import setup
from setuptools import find_packages
def gen_entry_points(pkgdir, e_prefix):
""" Generate entry_points={'console_scripts': []} records
relative to `pkgdir`.
"""
results = []
root = pkgdir
for f in os.listdir(pkgdir):
# Skip sub-directories
if os.path.isdir(f):
continue
# Skip non-script files and __init__
if not f.endswith('.py') or f.endswith('__init__.py'):
continue
# Python module name is derived from the filename without its extension
modname = os.path.splitext(f)[0]
# Python module path is the absolute path using "." instead of "/"
modpath = os.path.join(root, modname).replace(os.sep, ".")
# Create record
result = "{}_{}={}:{}".format(e_prefix, modname, modpath, "main")
# Save record
results += [result]
return results
PACKAGE_NAME = "nirspec_pipe_testing_tool"
BINPREFIX = "nptt"
ENTRY_POINTS = []
ENTRY_POINTS_PKGDIRS = [
os.path.normpath("{}/utils".format(PACKAGE_NAME)),
os.path.normpath("{}/calwebb_spec2_pytests/auxiliary_code".format(PACKAGE_NAME)),
]
for entry_point in ENTRY_POINTS_PKGDIRS:
ENTRY_POINTS += gen_entry_points(entry_point, BINPREFIX)
setup(
name=PACKAGE_NAME,
use_scm_version=True,
author="Maria Pena-Guerrero",
description="FILL THIS IN",
url="https://github.com/spacetelescope/{}".format(PACKAGE_NAME),
license="BSD",
classifiers=[
"License :: OSI Approved :: BSD License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Astronomy",
"Topic :: Software Development :: Testing",
],
python_requires=">=3.8",
setup_requires=[
"setuptools_scm",
],
install_requires=[
"astropy",
"matplotlib",
"msgpack",
"numpy",
"pysiaf",
"pytest>=5.0",
"pytest-html",
],
extras_require={
'pipeline': [
"jwst @ git+https://github.com/spacetelescope/jwst#branch=master",
]
},
packages=find_packages(),
package_data={
"": [
'*.cfg',
'*.json',
'*.txt',
],
},
entry_points = {
"console_scripts": ENTRY_POINTS,
},
)