diff mbox series

[1/2] python3-setuptools-scm: avoid SCM-based version detection

Message ID 20260708092252.1211669-2-HimaniRamesh.Barde@windriver.com
State Under Review
Headers show
Series python3-setuptools-scm: fix build and upgrade to 10.1.2 | expand

Commit Message

Barde, Himani Ramesh July 8, 2026, 9:22 a.m. UTC
setuptools-scm determines package version from SCM metadata (e.g. git tags).
In OpenEmbedded builds, sources are fetched as tarballs without a .git directory,
causing version detection to fail.

Export SETUPTOOLS_SCM_PRETEND_VERSION to override SCM-based version detection
and use the recipe version instead.

Signed-off-by: Himani Ramesh Barde <HimaniRamesh.Barde@windriver.com>
---
 meta/recipes-devtools/python/python3-setuptools-scm_10.0.5.bb | 2 ++
 1 file changed, 2 insertions(+)

Comments

Alexander Kanavin July 8, 2026, 11:16 a.m. UTC | #1
On Wed, 8 Jul 2026 at 11:36, Himani Ramesh Barde via
lists.openembedded.org
<HimaniRamesh.Barde=windriver.com@lists.openembedded.org> wrote:
>
> setuptools-scm determines package version from SCM metadata (e.g. git tags).
> In OpenEmbedded builds, sources are fetched as tarballs without a .git directory,
> causing version detection to fail.
>
> Export SETUPTOOLS_SCM_PRETEND_VERSION to override SCM-based version detection
> and use the recipe version instead.

Can you please show the error that occurs without this patch? I
suspect this is not the correct fix. Pypi tarballs are supposed to
work without special arrangements, and if they don't, it's an upstream
issue.

Alex
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-setuptools-scm_10.0.5.bb b/meta/recipes-devtools/python/python3-setuptools-scm_10.0.5.bb
index 3e86c4fd2c..58eb963910 100644
--- a/meta/recipes-devtools/python/python3-setuptools-scm_10.0.5.bb
+++ b/meta/recipes-devtools/python/python3-setuptools-scm_10.0.5.bb
@@ -12,6 +12,8 @@  PYPI_PACKAGE = "setuptools_scm"
 
 inherit pypi python_setuptools_build_meta
 
+export SETUPTOOLS_SCM_PRETEND_VERSION = "${PV}"
+
 DEPENDS += "\
     python3-packaging-native \
     python3-vcs-versioning-native \