-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
60 lines (47 loc) · 1.44 KB
/
setup.py
File metadata and controls
60 lines (47 loc) · 1.44 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
#!/usr/bin/env python3
"""
imcalc : fits image calculator using reverse polish notation
"""
## BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
## update it when the contents of directories change.
#import os
#if os.path.exists('MANIFEST'):
# os.remove('MANIFEST')
#from distutils.core import setup
# setuptools to allow 'python setup.py develop'. Not necessary for user.
try:
from setuptools import setup
except ImportError:
pass
from datetime import datetime
MAJOR = 0
MINOR = 1
ATTR = 'dev'
VERSION = '%d.%d%s' % (MAJOR, MINOR, ATTR)
## Is this needed?
def write_version_py(filename='imcalc/version.py'):
'''Write version file'''
cnt = """
# THIS FILE GENERATED BY SIMCADO SETUP.PY
version = '{}'
date = '{}'
"""
timestamp = datetime.utcnow().strftime('%Y-%m-%d %T GMT')
with open(filename, 'w') as fd1:
fd1.write(cnt.format(VERSION, timestamp))
def setup_package():
'''Setup the package'''
write_version_py()
setup(name='imcalc',
version=VERSION,
description="FITS image calculator",
author="Oliver Czoske",
author_email="oliver.czoske@univie.ac.at",
package_dir={'imcalc': 'imcalc'},
packages=['imcalc']
# for some reason include_package_data can be temperamental
#include_package_data=True,
#package_data = {'simcado': ['data/*']},
)
if __name__ == '__main__':
setup_package()