forked from cellmodeller/CellModeller
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
45 lines (39 loc) · 1.76 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
#!/usr/bin/env python
import os
from setuptools import setup
import subprocess
# Fetch version from git tags, and write to version.py.
# Also, when git is not available (PyPi package), use stored version.py.
version_py = os.path.join(os.path.dirname(__file__), 'CellModeller', 'version.py')
def get_git_version(default="0.1.0"):
try:
# Ensure the output from git is decoded to a string.
version_git = subprocess.check_output(["git", "describe"], text=True).strip()
# Format the version string to be PEP 440 compliant.
# Example: 'v4.3-45-g0b90179' -> '4.3.45+g0b90179'
# Adjust the formatting as per your versioning scheme.
version_git = version_git.lstrip('v').replace('-', '.').replace('.', '+git', 1)
except Exception:
# If git is not available, read the version from version.py
with open(version_py, 'r') as fh:
version_git_contents = fh.read().strip()
version_git = version_git_contents.split('=')[-1].replace('"', '').strip()
return version_git
# Use the function to get the version.
version = get_git_version()
setup(
name='CellModeller',
install_requires=['numpy', 'scipy', 'pyopengl', 'mako', 'pyqt5', 'pyopencl', 'reportlab', 'matplotlib'],
setup_requires=['numpy', 'scipy', 'pyopengl', 'mako', 'pyqt5', 'pyopencl', 'reportlab', 'matplotlib'],
packages=['CellModeller',
'CellModeller.Biophysics',
'CellModeller.Biophysics.BacterialModels',
'CellModeller.Biophysics.GeneralModels',
'CellModeller.Integration',
'CellModeller.Regulation',
'CellModeller.Signalling',
'CellModeller.GUI'],
package_data={'': ['*.cl', '*.ui']},
python_requires='>=3',
version=version
)