-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·58 lines (48 loc) · 1.83 KB
/
setup.py
File metadata and controls
executable file
·58 lines (48 loc) · 1.83 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
#!/usr/bin/env python3
"""
SimMETIS: A python package to simulate METIS, based on SimCADO
"""
from sys import version_info
from datetime import datetime
import setuptools
import pytest # not needed, but stops setup being included by sphinx.apidoc
from io import open # in py3 just an alias to builtin 'open'.
# In py2.7, allows encoding='utf-8'
# Version number
MAJOR = 0
MINOR = 3
ATTR = ''
VERSION = '%d.%d%s' % (MAJOR, MINOR, ATTR)
def write_version_py(filename='simmetis/version.py'):
'''Write a file version.py'''
cnt = """
# THIS FILE GENERATED BY SIMMETIS SETUP.PY
version = '{}'
date = '{}'
"""
timestamp = datetime.utcnow().strftime('%Y-%m-%d %T GMT')
with open(filename, 'w', encoding='utf-8') as fd:
if version_info.major == 2:
fd.write(cnt.format(VERSION, timestamp).decode('utf-8'))
else:
fd.write(cnt.format(VERSION, timestamp))
with open("README.md", "r", encoding='utf-8') as fh:
long_description = fh.read()
def setup_package():
# Rewrite the version file every time
write_version_py()
setuptools.setup(name='SimMETIS',
version=VERSION,
description="METIS Instrument simulator",
author="Kieran Leschinski, Oliver Czoske, Rainer Köhler, Leonard Burtscher, Roy van Boekel",
author_email ="""kieran.leschinski@unive.ac.at,
oliver.czoske@univie.ac.at,
Rainer.Koehler@univie.ac.at,
burtscher@strw.leidenuniv.nl
boekel@mpia.de""",
url="http://metis.strw.leidenuniv.nl/wiki/doku.php?id=sim:simulator",
packages=['simmetis'],
package_data={'simmetis': ['data/*']}
)
if __name__ == '__main__':
setup_package()