From 5ba7d562af3b935d85d31e32c6c6e8b296517ecb Mon Sep 17 00:00:00 2001 From: Silia Taider Date: Mon, 31 Aug 2026 15:47:51 +0200 Subject: [PATCH] [ci][wheels] Derive the wheel version from RVersion.hxx --- pyproject.toml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 0e6967622ce65..61b81a796936e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] -requires = ["scikit-build-core>=0.10"] +requires = ["scikit-build-core>=1.0"] # the dynamic metadata syntax below is a scikit-build-core 1.0 feature build-backend = "scikit_build_core.build" [project] name = "root" -version = "0.1a14" +dynamic = ["version"] requires-python = ">=3.10" maintainers = [ {name = "Vincenzo Eduardo Padulano", email = "vincenzo.eduardo.padulano@cern.ch"} @@ -16,6 +16,25 @@ dependencies = [ "numpy", ] +# The wheel version is derived automatically from ROOT's version macros +# in RVersion.hxx bumped every release, with a PEP 440 pre-release suffix +# appended. ex.: ROOT 6.42.02 -> wheel version "6.42.2a1". +# The "a1" marks an alpha pre-release. Bump it manually ("a1" -> "a2") +# only to re-publish a wheel for a ROOT version already on PyPI since PyPI +# refuses a filename it has already seen, this should only happen in case +# of a failed/ broken upload of the first wheel. +# Reset to "a1" for the next ROOT release. +[[tool.dynamic-metadata]] +provider = "scikit_build_core.metadata.regex" +field = "version" +input = "core/foundation/inc/ROOT/RVersion.hxx" +regex = '''(?sx) + \#define \s+ ROOT_VERSION_MAJOR \s+ (?P\d+) .*? + \#define \s+ ROOT_VERSION_MINOR \s+ (?P\d+) .*? + \#define \s+ ROOT_VERSION_PATCH \s+ (?P\d+) +''' +result = "{major}.{minor}.{patch}a1" + # Point backend to python packages and to explicitly use Ninja [tool.scikit-build] install.strip = false