-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
137 lines (88 loc) · 3.65 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
132
133
134
135
# -*- coding: utf-8 -*-
"""
SOAR Telescope - Goodman Pipeline.
Goodman High Throughput Spectrograph Data Reduction Pipeline.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sampleproject
"""
import os
import sys
# Always prefer setuptools over distutils
from setuptools import setup, find_packages
# To use a consistent encoding
from codecs import open
here = os.path.abspath(os.path.dirname(__file__))
def create_version_py(packagename, version, source_dir='.'):
package_dir = os.path.join(source_dir, packagename)
version_py = os.path.join(package_dir, 'version.py')
version_str = "# This is an automatic generated file please do not edit\n" \
"__version__ = '{:s}'".format(version)
with open(version_py, 'w') as f:
f.write(version_str)
# Get configuration information from setup.cfg
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser
conf = ConfigParser()
# conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
conf.read([os.path.join(os.path.dirname(__file__), 'setup.cfg')])
metadata = dict(conf.items('metadata'))
PACKAGENAME = metadata['package_name']
VERSION = metadata['version']
LICENSE = metadata['license']
DESCRIPTION = metadata['description']
LONG_DESCRIPTION = metadata['long_description']
AUTHOR = metadata['author']
AUTHOR_EMAIL = metadata['author_email']
GITHUB_PROJECT = metadata['github_project']
# freezes version information in version.py
create_version_py(PACKAGENAME, VERSION)
setup(
name=metadata['package_name'],
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version=VERSION,
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
# The project's main homepage.
url='https://github.com/{:s}0'.format(GITHUB_PROJECT),
# Author details
author=u'Simon Torres R.',
author_email='[email protected], '
# Choose your license
license=LICENSE,
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Intended Audience :: Education',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: {:s}'.format(LICENSE),
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Natural Language :: English',
'Operating System :: POSIX :: Linux',
'Operating System :: POSIX :: Other',
'Operating System :: MacOS :: MacOS X',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: Software Development :: Libraries :: Python Modules',
],
# What does your project relate to?
keywords='soar pipelines astronomy images spectroscopy data reference lamps wavelength',
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
packages=['goodman_lamps',
],
package_dir={'goodman_lamps': 'goodman_lamps'},
package_data={'goodman_lamps': ['data/lamps/*.fits',
'data/nist/*.txt']},
)