Newer
Older
from setuptools import setup
import subprocess
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
def write_version_file(version):
""" Writes a file with version information to be used at run time
Parameters
----------
version: str
A string containing the current version information
Returns
-------
version_file: str
A path to the version file
"""
try:
git_log = subprocess.check_output(
['git', 'log', '-1', '--pretty=%h %ai']).decode('utf-8')
git_diff = (subprocess.check_output(['git', 'diff', '.'])
+ subprocess.check_output(
['git', 'diff', '--cached', '.'])).decode('utf-8')
if git_diff == '':
status = '(CLEAN) ' + git_log
else:
status = '(UNCLEAN) ' + git_log
except subprocess.CalledProcessError:
status = ''
version_file = '.version'
if path.isfile(version_file) is False:
with open('tupak/' + version_file, 'w+') as f:
f.write('{} - {}'.format(version, status))
return version_file
def get_long_description():
""" Finds the README and reads in the description """
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst')) as f:
long_description = f.read()
return long_description
version = '0.2.1'
version_file = write_version_file(version)
long_description = get_long_description()
description='The User friendly Parameter estimAtion Kode',
author='Greg Ashton, Moritz Huebner, Paul Lasky, Colm Talbot',
author_email='paul.lasky@monash.edu',
license="MIT",
packages=['tupak', 'tupak.core', 'tupak.gw', 'tupak.hyper', 'cli_tupak'],
package_dir={'tupak': 'tupak'},
package_data={'tupak.gw': ['prior_files/*', 'noise_curves/*.txt',
'detectors/*'],
'tupak': [version_file]},
install_requires=[
'future',
'dynesty',
'corner',
'deepdish',
'pandas',
entry_points={'console_scripts':
['tupak_plot=cli_tupak.plot_multiple_posteriors:main']
})