Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use setuptools_scm for package versions #243

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/python/benchmark_models_petab/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,11 @@

from .base import get_problem, get_problem_yaml_path
from .C import MODEL_DIRS, MODELS, MODELS_DIR
from .version import __version__
from .overview import get_overview_df
from importlib.metadata import PackageNotFoundError, version

try:
__version__ = version("benchmark_models_petab")
except PackageNotFoundError:
# package is not installed
pass
3 changes: 0 additions & 3 deletions src/python/benchmark_models_petab/version.py

This file was deleted.

3 changes: 3 additions & 0 deletions src/python/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ cp -r "../../$DATA_DIR" $BUILD_DIR/$CODE_DIR
# Hop into
cd $BUILD_DIR

# update git root in setuptools_scm configuration
sed -ri 's/root = "..\/.."/root = "..\/..\/.."/' pyproject.toml

# Build
pip install --upgrade build
python -m build --sdist
14 changes: 4 additions & 10 deletions src/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
[build-system]
requires = [
"setuptools",
"wheel",
"petab",
]
requires = ["setuptools>=64", "setuptools-scm>=8"]
build-backend = "setuptools.build_meta"


[project]
name = "benchmark_models_petab"
description = "A collection of models with experimental data in the PEtab format"
Expand All @@ -33,17 +28,16 @@ dependencies = [
[project.optional-dependencies]
dev = ["ruff"]

[tool.setuptools.dynamic]
version = {attr = "benchmark_models_petab.__version__"}

[project.scripts]
bmp-petablint = "benchmark_models_petab.check_petablint:main"
bmp-check-sbml-metadata = "benchmark_models_petab.check_sbml_metadata:main"
bmp-create-overview = "benchmark_models_petab.overview:main"

[tool.setuptools_scm]
root = "../.."

[tool.ruff]
line-length = 79


[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]