-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
86 lines (71 loc) · 2.78 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
#!/usr/bin/env python3
"""
SimCADO: A python package to simulate MICADO
============================================
$ pip install wheel twine
How to compile and put these on pip::
$ python setup.py sdist bdist_wheel
$ twine upload dist/*
"""
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 = 7
ATTR = ''
VERSION = '%d.%d%s' % (MAJOR, MINOR, ATTR)
def write_version_py(filename='simcado/version.py'):
"""Write a file version.py"""
cnt = """
# THIS FILE GENERATED BY SIMCADO 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 = 'SimCADO',
version = VERSION,
description = "SimCADO: The MICADO Instrument simulator",
long_description = long_description,
long_description_content_type = 'text/markdown',
author = "Kieran Leschinski, Oliver Czoske, Miguel Verdugo",
author_email = """kieran.leschinski@unive.ac.at,
oliver.czoske@univie.ac.at,
miguel.verdugo@univie.ac.at""",
url = "https://simcado.readthedocs.io/en/latest/",
license = "MIT",
package_dir = {'simcado': 'simcado'},
packages = ['simcado'],
package_data = {'simcado': ['simcado/data/default.config']},
include_package_data=True,
# data_files=[('data/', ['default.config']),],
install_requires = ["numpy>1.10.4",
"scipy>0.17",
"astropy>1.1.2",
"wget>3.0",
"requests>2.0",
"synphot>0.1",
"matplotlib>1.5.0",
"poppy>0.4",
"pyyaml",],
classifiers = ["Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Astronomy",]
)
if __name__ == '__main__':
setup_package()