forked from nithyanandan/AstroUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
55 lines (50 loc) · 2.41 KB
/
setup.py
File metadata and controls
55 lines (50 loc) · 2.41 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
import setuptools, re, glob, os
from setuptools import setup, find_packages
from subprocess import Popen, PIPE
githash = 'unknown'
if os.path.isdir(os.path.dirname(os.path.abspath(__file__))+'/.git'):
try:
gitproc = Popen(['git', 'rev-parse', 'HEAD'], stdout = PIPE)
githash = gitproc.communicate()[0]
if gitproc.returncode != 0:
print "unable to run git, assuming githash to be unknown"
githash = 'unknown'
except EnvironmentError:
print "unable to run git, assuming githash to be unknown"
githash = githash.replace('\n', '')
with open(os.path.dirname(os.path.abspath(__file__))+'/astroutils/githash.txt', 'w+') as githash_file:
githash_file.write(githash)
metafile = open('./astroutils/__init__.py').read()
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", metafile))
setup(name='AstroUtils',
version=metadata['version'],
description=metadata['description'],
long_description=open("README.rst").read(),
url=metadata['url'],
author=metadata['author'],
author_email=metadata['authoremail'],
maintainer=metadata['maintainer'],
maintainer_email=metadata['maintaineremail'],
license='MIT',
classifiers=['Development Status :: 4 - Beta',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 2.7',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Astronomy',
'Topic :: Utilities'],
packages=find_packages(),
package_data={'astroutils': ['*.txt', 'examples/cosmotile/*.yaml',
'examples/image_cutout/*.yaml']},
include_package_data=True,
scripts=glob.glob('scripts/*.py'),
install_requires=['astropy>=1.0, <3.0', 'blessings>=1.6', 'healpy>=1.5.3',
'ipdb>=0.6.1', 'mpi4py>=1.2.2', 'numpy>=1.8.1',
'pyephem>=3.7.5.3', 'scipy>=0.15.1', 'astroquery>=0.3.8',
'beautifulsoup4>=4.6', 'scikit-image'],
setup_requires=['astropy>=1.0, <3.0', 'blessings>=1.6', 'ipdb>=0.6.1',
'healpy>=1.5.3', 'mpi4py>=1.2.2', 'numpy>=1.8.1',
'pyephem>=3.7.5.3', 'pytest-runner', 'scipy>=0.15.1',
'astroquery>=0.3.8', 'beautifulsoup4>=4.6', 'scikit-image<0.15'],
tests_require=['pytest'],
zip_safe=False)