-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
112 lines (100 loc) · 2.97 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
112
from setuptools import setup, find_packages
import sys
import os
import re
# Source files are expected to exist at: github.com/{orga}/{repo}/{name}
org = 'dilpath'
repo = 'petab_control'
name = 'petab_control'
def read(fname):
"""Read a file."""
return open(fname).read()
def absolute_links(txt):
"""Replace relative petab github links by absolute links."""
raw_base = \
f"(https://raw.githubusercontent.com/{org}/{repo}/main/"
embedded_base = \
f"(https://github.com/{org}/{repo}/tree/main/"
# iterate over links
for var in re.findall(r'\[.*?\]\((?!http).*?\)', txt):
if re.match(r'.*?.(png|svg)\)', var):
# link to raw file
rep = var.replace("(", raw_base)
else:
# link to github embedded file
rep = var.replace("(", embedded_base)
txt = txt.replace(var, rep)
return txt
# 3.7.1 for NumPy
minimum_python_version = '3.7.1'
if sys.version_info < tuple(map(int, minimum_python_version.split('.'))):
sys.exit(f'PEtab Control requires Python >= {minimum_python_version}.')
# read version from file
__version__ = ''
version_file = os.path.join(name, 'version.py')
# sets __version__
exec(read(version_file)) # pylint: disable=W0122 # nosec
#ENTRY_POINTS = {
# 'console_scripts': [
# f'{name} = {name}.control',
# ]
#}
# project metadata
# noinspection PyUnresolvedReferences
setup(
name=name,
version=__version__,
description='Optimal control extension for PEtab',
long_description=absolute_links(read('README.md')),
long_description_content_type="text/markdown",
#author='The PEtab optimal control extension developers',
#author_email='[email protected]',
url=f'https://github.com/{org}/{repo}',
packages=find_packages(exclude=['doc*', 'test*']),
install_requires=[
'petab>=0.1.19',
'python-slugify', # TODO version
#'numpy>=1.15.1',
#'pandas>=1.2.0',
#'matplotlib>=2.2.3',
#'python-libsbml>=5.17.0',
#'sympy',
#'colorama',
#'seaborn',
#'pyyaml',
#'jsonschema',
],
include_package_data=True,
tests_require=[
#'flake8',
'pytest',
#'python-libcombine',
],
python_requires=f'>={minimum_python_version}',
#entry_points=ENTRY_POINTS,
extras_require={
'examples': [
'amici',
'fides',
'pypesto',
'more_itertools',
'notebook',
'numpy',
'pandas',
'yaml2sbml',
'petab_timecourse',
],
#'reports': ['Jinja2'],
#'combine': ['python-libcombine>=0.2.6'],
#'doc': [
# 'sphinx>=3.5.3',
# 'sphinxcontrib-napoleon>=0.7',
# 'sphinx-markdown-tables>=0.0.15',
# 'sphinx-rtd-theme>=0.5.1',
# 'recommonmark>=0.7.1',
# 'nbsphinx>=0.8.2',
# 'm2r>=0.2.1',
# 'ipython>=7.21.0',
#]
}
)