-
Notifications
You must be signed in to change notification settings - Fork 15
/
setup.py
executable file
·111 lines (100 loc) · 4.21 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# TAMkin is a post-processing toolkit for normal mode analysis, thermochemistry
# and reaction kinetics.
# Copyright (C) 2008-2012 Toon Verstraelen <[email protected]>, An Ghysels
# <[email protected]> and Matthias Vandichel <[email protected]>
# Center for Molecular Modeling (CMM), Ghent University, Ghent, Belgium; all
# rights reserved unless otherwise stated.
#
# This file is part of TAMkin.
#
# TAMkin is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# In addition to the regulations of the GNU General Public License,
# publications and communications based in parts on this program or on
# parts of this program are required to cite the following article:
#
# "TAMkin: A Versatile Package for Vibrational Analysis and Chemical Kinetics",
# An Ghysels, Toon Verstraelen, Karen Hemelsoet, Michel Waroquier and Veronique
# Van Speybroeck, Journal of Chemical Information and Modeling, 2010, 50,
# 1736-1750W
# http://dx.doi.org/10.1021/ci100099g
#
# TAMkin is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>
#
# --
from __future__ import print_function
import os
import subprocess
import sys
from setuptools import setup
pypkg="tamkin"
# Try to get the version from git describe
__version__ = None
try:
print('Trying to get the version from git describe')
git_describe = subprocess.check_output(["git", "describe", "--tags"])
version_words = git_describe.decode('utf-8').strip().split('-')
__version__ = version_words[0]
if len(version_words) > 1:
__version__ += '.post' + version_words[1]
print('Version from git describe: {}'.format(__version__))
except (subprocess.CalledProcessError, OSError):
pass
# Interact with version.py
fn_version = os.path.join(os.path.dirname(__file__), pypkg, 'version.py')
version_template = """\
\"""Do not edit this file, versioning is governed by ``git describe --tags`` and ``setup.py``.\"""
__version__ = '{}'
"""
if __version__ is None:
print('Trying to get the version from {}',format(fn_version))
# Try to load the git version tag from version.py
try:
with open(fn_version, 'r') as fh:
__version__ = fh.read().split('=')[-1].replace('\'', '').strip()
except IOError:
print('Could not determine version. Giving up.')
sys.exit(1)
print('Version according to {}: {}'.format(fn_version, __version__))
else:
# Store the git version tag in version.py
print('Writing version to {}'.format(fn_version))
with open(fn_version, 'w') as fh:
fh.write(version_template.format(__version__))
setup(
name=pypkg,
version=__version__,
description='TAMkin is a post-processing toolkit for thermochemistry and kinetics analysis.',
author='Toon Verstraelen, Matthias Vandichel, An Ghysels',
url='https://github.com/molmod/tamkin',
package_dir = {'tamkin': 'tamkin'},
packages = ['tamkin', 'tamkin.io', 'tamkin.test'],
entry_points={
'console_scripts': ['tamkin-driver = tamkin.driver:main']
},
include_package_data=True,
install_requires=['numpy>=1.0', 'matplotlib>1.1', 'molmod>=1.4.5', 'scipy>=0.17.1'],
classifiers=[
'Environment :: Console',
'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Scientific/Engineering :: Physics',
'Topic :: Scientific/Engineering :: Chemistry',
'Intended Audience :: Science/Research',
])