-
Notifications
You must be signed in to change notification settings - Fork 23
/
setup.py
executable file
·68 lines (61 loc) · 2.22 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
#!/usr/bin/env python
import glob
import os
import sys
from setuptools import setup, find_packages
setup_keywords = dict()
setup_keywords['name'] = 'legacypipe'
setup_keywords['description'] = 'DECam Legacy Survey data reduction pipeline'
setup_keywords['author'] = 'DECaLS Collaboration'
setup_keywords['author_email'] = '[email protected]'
setup_keywords['license'] = 'GPLv2'
setup_keywords['url'] = 'https://github.com/legacysurvey/legacypipe'
#
# Setup.py, you suck
#setup_keywords['test_suite'] = 'nose.collector'
#setup_keywords['tests_require'] = ['nose']
#setup_keywords['test_suite'] = 'py/test'
#setup_keywords['test_suite'] = 'run_tests'
#
# Import this module to get __doc__ and __version__.
#
sys.path.insert(int(sys.path[0] == ''),'./py')
try:
from importlib import import_module
product = import_module(setup_keywords['name'])
setup_keywords['long_description'] = product.__doc__
from legacypipe.survey import get_git_version
version = get_git_version(os.path.dirname(__file__)).replace('-','.')
setup_keywords['version'] = version
except ImportError:
#
# Try to get the long description from the README.rst file.
#
if os.path.exists('README.rst'):
with open('README.rst') as readme:
setup_keywords['long_description'] = readme.read()
else:
setup_keywords['long_description'] = ''
setup_keywords['version'] = 'dr3.dev'
#
# Set other keywords for the setup function. These are automated, & should
# be left alone unless you are an expert.
#
# Treat everything in bin/*.{py,sh,slurm} 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 os.path.basename(fname).split('.')[-1] in ['sh', 'py', 'slurm']]
setup_keywords['provides'] = [setup_keywords['name']]
setup_keywords['requires'] = ['Python (>3.6.0)']
setup_keywords['zip_safe'] = False
print('Finding packages...')
setup_keywords['packages'] = find_packages('py')
print('Done finding packages.')
setup_keywords['package_dir'] = {'':'py'}
setup_keywords['package_data'] = {'legacypipe': ['config/*', 'data/*'],
'legacyzpts': ['data/*']}
#
# Run setup command.
#
setup(**setup_keywords)