diff mbox series

[meta-python,2/5] python3-canopen: Switch to python_setuptools_build_meta

Message ID 20260729052901.2147056-2-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-python,1/5] python3-thrift: Switch to python_setuptools_build_meta | expand

Commit Message

Khem Raj July 29, 2026, 5:28 a.m. UTC
From: Khem Raj <raj.khem@gmail.com>

canopen's pyproject.toml declares setuptools.build_meta as its build backend,
so setuptools3 is the wrong class and do_check_backend warns:

  QA Issue: inherits setuptools3 but has pyproject.toml with
  setuptools.build_meta, use the correct class [pep517-backend]

Unlike setup.py, pyproject-build honours the declared build requirements, so
the setuptools_scm dependency has to be provided explicitly, otherwise
do_compile fails with:

  ERROR Unmet dependencies ...
	setuptools_scm>=8
		wanted: >=8
		found: not installed

setuptools_scm was silently ignored before, so the package used to ship its
metadata as canopen-0.0.0.dist-info. Pin the version to ${PV} so the
directory is now correctly named canopen-2.4.1.dist-info.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 .../recipes-devtools/python/python3-canopen_2.4.1.bb       | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/meta-python/recipes-devtools/python/python3-canopen_2.4.1.bb b/meta-python/recipes-devtools/python/python3-canopen_2.4.1.bb
index 80c39f6c2c..b0c6f9f10e 100644
--- a/meta-python/recipes-devtools/python/python3-canopen_2.4.1.bb
+++ b/meta-python/recipes-devtools/python/python3-canopen_2.4.1.bb
@@ -5,7 +5,12 @@  LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=97f135a6ee6f800c377b5512122c7a8d"

 SRC_URI[sha256sum] = "20a84bc498b34dadd79cece467d3bbe19591c1c02a8f39331bcc6065c4d8b2eb"

-inherit setuptools3 pypi
+DEPENDS += "python3-setuptools-scm-native"
+
+inherit python_setuptools_build_meta pypi
+
+# The sdist has no git metadata for setuptools_scm to look at.
+export SETUPTOOLS_SCM_PRETEND_VERSION = "${PV}"

 RDEPENDS:${PN} += "\
   python3-can \