Skip to content
Snippets Groups Projects
setup.py 1.17 KiB
Newer Older
#!/usr/bin/env python

from distutils.core import setup
import subprocess

# Write a version file containing the git hash and info
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 = "NO VERSION INFORMATION"

version_file = '.version'
with open('tupak/' + version_file, 'w+') as f:
    f.write(status)
setup(name='tupak',
Gregory Ashton's avatar
Gregory Ashton committed
      description='The User friendly Parameter estimAtion Kode',
      url='https://git.ligo.org/Monash/tupak',
      author='Greg Ashton, Moritz Hübner, Paul Lasky, Colm Talbot',
      author_email='paul.lasky@monash.edu',
      license="MIT",
      version='0.1',
      packages=['tupak', 'tupak.core', 'tupak.gw'],
      package_dir={'tupak': 'tupak'},
Colm Talbot's avatar
Colm Talbot committed
      package_data={'tupak.gw': ['prior_files/*', 'noise_curves/*.txt'],
                    'tupak': [version_file]}