Skip to content

Commit 118fab5

Browse files
dweindldilpath
andauthored
Set up setuptools_scm (PEtab-dev#100)
Set up `setuptools_scm` and move most package configuration to `pyproject.toml`. Move git-based package URLs out of `pyproject.toml` (otherwise, PyPI upload will fail). Co-authored-by: Dilan Pathirana <59329744+dilpath@users.noreply.github.com>
1 parent 3708506 commit 118fab5

File tree

5 files changed

+58
-74
lines changed

5 files changed

+58
-74
lines changed

petab_select/version.py

-2
This file was deleted.

pyproject.toml

+55-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,61 @@
11
[build-system]
2-
requires = [
3-
"setuptools>=42",
4-
"wheel"
5-
]
2+
requires = ["setuptools>=64", "setuptools-scm>=8"]
63
build-backend = "setuptools.build_meta"
74

5+
[project]
6+
name = "petab_select"
7+
dynamic = ["version"]
8+
maintainers = [
9+
{name = "Dilan Pathirana", email = "dilan.pathirana@uni-bonn.de"},
10+
]
11+
authors = [
12+
{name = "The PEtab Select developers"},
13+
]
14+
description = "PEtab Select: an extension to PEtab for model selection."
15+
readme = "README.md"
16+
requires-python = ">=3.10"
17+
license = {text = "BSD-3-Clause"}
18+
dependencies = [
19+
# TODO minimum versions
20+
"more-itertools",
21+
"numpy",
22+
"pandas",
23+
"petab",
24+
"pyyaml",
25+
"click",
26+
"dill",
27+
]
28+
[project.optional-dependencies]
29+
test = [
30+
"pytest >= 5.4.3",
31+
"pytest-cov >= 2.10.0",
32+
"amici >= 0.11.25",
33+
"fides >= 0.7.5",
34+
"pypesto > 0.2.13",
35+
"tox >= 3.12.4",
36+
"flake8 >= 4.0.1",
37+
]
38+
doc = [
39+
"sphinx>=3.5.3,<7",
40+
"sphinxcontrib-napoleon>=0.7",
41+
"sphinx-markdown-tables>=0.0.15",
42+
"sphinx-rtd-theme>=0.5.1",
43+
"recommonmark>=0.7.1",
44+
# pin until ubuntu comes with newer pandoc:
45+
# /home/docs/checkouts/readthedocs.org/user_builds/petab-select/envs/63/lib/python3.11/site-packages/nbsphinx/__init__.py:1058: RuntimeWarning: You are using an unsupported version of pandoc (2.9.2.1).
46+
# Your version must be at least (2.14.2) but less than (4.0.0).
47+
"nbsphinx==0.9.1",
48+
"nbconvert<7.5.0",
49+
"ipython>=7.21.0",
50+
"readthedocs-sphinx-ext>=2.2.5",
51+
"sphinx-autodoc-typehints",
52+
]
53+
54+
[project.scripts]
55+
petab_select = "petab_select.cli:cli"
56+
57+
[tool.setuptools_scm]
58+
859
[tool.black]
960
line-length = 79
1061
target-version = ['py37', 'py38', 'py39']

requirements_dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
git+https://github.com/ICB-DCM/pyPESTO.git@develop#egg=pypesto
12
tox >= 3.12.4
23
pre-commit >= 2.10.1
34
flake8 >= 4.0.1

setup.py

-68
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import os
22
import re
3-
import sys
43

54
from setuptools import find_packages, setup
65

@@ -30,79 +29,12 @@ def absolute_links(txt):
3029
return txt
3130

3231

33-
minimum_python_version = '3.10'
34-
if sys.version_info < tuple(map(int, minimum_python_version.split('.'))):
35-
sys.exit(f'PEtab Select requires Python >= {minimum_python_version}')
36-
37-
# read version from file
38-
__version__ = ''
39-
version_file = os.path.join('petab_select', 'version.py')
40-
# sets __version__
41-
exec(read(version_file)) # pylint: disable=W0122 # nosec
42-
43-
ENTRY_POINTS = {
44-
'console_scripts': [
45-
'petab_select = petab_select.cli:cli',
46-
]
47-
}
48-
4932
# project metadata
5033
# noinspection PyUnresolvedReferences
5134
setup(
52-
name='petab_select',
53-
version=__version__,
54-
description='PEtab Select: an extension to PEtab for model selection.',
5535
long_description=absolute_links(read('README.md')),
5636
long_description_content_type="text/markdown",
57-
# author='The PEtab Select developers',
58-
# author_email='dilan.pathirana@uni-bonn.de',
5937
url=f'https://github.com/{org}/{repo}',
6038
packages=find_packages(exclude=['doc*', 'test*']),
61-
install_requires=[
62-
# TODO minimum versions
63-
'more-itertools',
64-
'numpy',
65-
'pandas',
66-
'petab',
67-
'pyyaml',
68-
#'python-libsbml>=5.17.0',
69-
#'sympy',
70-
# required for CLI
71-
'click',
72-
'dill',
73-
# plotting
74-
#'matplotlib>=2.2.3',
75-
#'seaborn',
76-
],
7739
include_package_data=True,
78-
python_requires=f'>={minimum_python_version}',
79-
entry_points=ENTRY_POINTS,
80-
extras_require={
81-
'test': [
82-
'pytest >= 5.4.3',
83-
'pytest-cov >= 2.10.0',
84-
'amici >= 0.11.25',
85-
'fides >= 0.7.5',
86-
# FIXME
87-
# 'pypesto > 0.2.13',
88-
'pypesto @ git+https://github.com/ICB-DCM/pyPESTO.git@select_use_old_calibrations#egg=pypesto',
89-
'tox >= 3.12.4',
90-
'flake8 >= 4.0.1',
91-
],
92-
'doc': [
93-
'sphinx>=3.5.3,<7',
94-
'sphinxcontrib-napoleon>=0.7',
95-
'sphinx-markdown-tables>=0.0.15',
96-
'sphinx-rtd-theme>=0.5.1',
97-
'recommonmark>=0.7.1',
98-
# pin until ubuntu comes with newer pandoc:
99-
# /home/docs/checkouts/readthedocs.org/user_builds/petab-select/envs/63/lib/python3.11/site-packages/nbsphinx/__init__.py:1058: RuntimeWarning: You are using an unsupported version of pandoc (2.9.2.1).
100-
# Your version must be at least (2.14.2) but less than (4.0.0).
101-
'nbsphinx==0.9.1',
102-
'nbconvert<7.5.0',
103-
'ipython>=7.21.0',
104-
'readthedocs-sphinx-ext>=2.2.5',
105-
'sphinx-autodoc-typehints',
106-
],
107-
},
10840
)

tox.ini

+2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ description =
1818

1919
[testenv:base]
2020
extras = test
21+
deps =
22+
git+https://github.com/ICB-DCM/pyPESTO.git@develop\#egg=pypesto
2123
commands =
2224
pytest --cov=petab_select --cov-report=xml --cov-append test -s
2325
coverage report

0 commit comments

Comments
 (0)