Skip to content

Commit

Permalink
Set up setuptools_scm
Browse files Browse the repository at this point in the history
Set up setuptools_scm and move most package configuration to pyproject.toml.
  • Loading branch information
dweindl committed Oct 15, 2024
1 parent a2ef99c commit 972e660
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 72 deletions.
2 changes: 0 additions & 2 deletions petab_select/version.py

This file was deleted.

57 changes: 53 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,59 @@
[build-system]
requires = [
"setuptools>=42",
"wheel"
]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"

[project]
name = "petab_select"
dynamic = ["version"]
maintainers = [
{name = "Dilan Pathirana", email = "[email protected]"},
]
authors = [
{name = "The PEtab Select developers"},
]
description = "PEtab Select: an extension to PEtab for model selection."
readme = "README.md"
requires-python = ">=3.10"
license = {text = "BSD-3-Clause"}
dependencies = [
# TODO minimum versions
"more-itertools",
"numpy",
"pandas",
"petab",
"pyyaml",
"click",
"dill",
]
[project.optional-dependencies]
test = [
"pytest >= 5.4.3",
"pytest-cov >= 2.10.0",
"amici >= 0.11.25",
"fides >= 0.7.5",
"pypesto > 0.2.13",
]
doc = [
"sphinx>=3.5.3,<7",
"sphinxcontrib-napoleon>=0.7",
"sphinx-markdown-tables>=0.0.15",
"sphinx-rtd-theme>=0.5.1",
"recommonmark>=0.7.1",
# pin until ubuntu comes with newer pandoc:
# /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).
# Your version must be at least (2.14.2) but less than (4.0.0).
"nbsphinx==0.9.1",
"nbconvert<7.5.0",
"ipython>=7.21.0",
"readthedocs-sphinx-ext>=2.2.5",
"sphinx-autodoc-typehints",
]

[project.scripts]
petab_select = "petab_select.cli:cli"

[tool.setuptools_scm]

[tool.black]
line-length = 79
target-version = ['py37', 'py38', 'py39']
Expand Down
66 changes: 0 additions & 66 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import re
import sys

from setuptools import find_packages, setup

Expand Down Expand Up @@ -30,77 +29,12 @@ def absolute_links(txt):
return txt


minimum_python_version = '3.10'
if sys.version_info < tuple(map(int, minimum_python_version.split('.'))):
sys.exit(f'PEtab Select requires Python >= {minimum_python_version}')

# read version from file
__version__ = ''
version_file = os.path.join('petab_select', 'version.py')
# sets __version__
exec(read(version_file)) # pylint: disable=W0122 # nosec

ENTRY_POINTS = {
'console_scripts': [
'petab_select = petab_select.cli:cli',
]
}

# project metadata
# noinspection PyUnresolvedReferences
setup(
name='petab_select',
version=__version__,
description='PEtab Select: an extension to PEtab for model selection.',
long_description=absolute_links(read('README.md')),
long_description_content_type="text/markdown",
# author='The PEtab Select developers',
# author_email='[email protected]',
url=f'https://github.com/{org}/{repo}',
packages=find_packages(exclude=['doc*', 'test*']),
install_requires=[
# TODO minimum versions
'more-itertools',
'numpy',
'pandas',
'petab',
'pyyaml',
#'python-libsbml>=5.17.0',
#'sympy',
# required for CLI
'click',
'dill',
# plotting
#'matplotlib>=2.2.3',
#'seaborn',
],
include_package_data=True,
python_requires=f'>={minimum_python_version}',
entry_points=ENTRY_POINTS,
extras_require={
'test': [
'pytest >= 5.4.3',
'pytest-cov >= 2.10.0',
'amici >= 0.11.25',
'fides >= 0.7.5',
# FIXME
'pypesto > 0.2.13',
# 'pypesto @ git+https://github.com/ICB-DCM/pyPESTO.git@develop#egg=pypesto',
],
'doc': [
'sphinx>=3.5.3,<7',
'sphinxcontrib-napoleon>=0.7',
'sphinx-markdown-tables>=0.0.15',
'sphinx-rtd-theme>=0.5.1',
'recommonmark>=0.7.1',
# pin until ubuntu comes with newer pandoc:
# /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).
# Your version must be at least (2.14.2) but less than (4.0.0).
'nbsphinx==0.9.1',
'nbconvert<7.5.0',
'ipython>=7.21.0',
'readthedocs-sphinx-ext>=2.2.5',
'sphinx-autodoc-typehints',
],
},
)

0 comments on commit 972e660

Please sign in to comment.