summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Straka <derek@asterius.io>2023-09-20 20:06:29 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-09-22 07:45:17 +0100
commit3c8cfbfc045fdf78382812c13a32dae2799c2898 (patch)
treee5f07dc9b79a3c9cec226fbccf5b5f746b1f11d9
parentc94c1ba7c77b2f7c599b4c0f24bab0c3b07ab6d3 (diff)
downloadpoky-3c8cfbfc045fdf78382812c13a32dae2799c2898.tar.gz
pypi.bbclass: Update the upstream checks to automatically replace '_' with '-'
For a number of existing packages, the pypi URI contains '-', but the package name (PYPI_PACKAGE) uses '_'. Add a simple replace for the UPSTREAM_CHECK_URI and UPSTREAM_CHECK_REGEX. The change resulted in 19 additional auto-detected upstream checks for python packages meta-python. It did break upstream checks for 3 packages that will be patched shortly: - python3-ipython-genutils - python3-ninja-syntax - python3-wpa-supplicant (From OE-Core rev: f4e2923bfac8a0a5b702ffd2dd957213a6268f6b) Signed-off-by: Derek Straka <derek@asterius.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes-recipe/pypi.bbclass6
1 files changed, 4 insertions, 2 deletions
diff --git a/meta/classes-recipe/pypi.bbclass b/meta/classes-recipe/pypi.bbclass
index f510bfed06..b8c18ccf39 100644
--- a/meta/classes-recipe/pypi.bbclass
+++ b/meta/classes-recipe/pypi.bbclass
@@ -30,7 +30,9 @@ SECTION = "devel/python"
30SRC_URI:prepend = "${PYPI_SRC_URI} " 30SRC_URI:prepend = "${PYPI_SRC_URI} "
31S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}" 31S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"
32 32
33UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${PYPI_PACKAGE}/" 33# Replace any '_' characters in the pypi URI with '-'s to follow the PyPi website naming conventions
34UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)/" 34UPSTREAM_CHECK_PYPI_PACKAGE ?= "${@d.getVar('PYPI_PACKAGE').replace('_', '-')}"
35UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${UPSTREAM_CHECK_PYPI_PACKAGE}/"
36UPSTREAM_CHECK_REGEX ?= "/${UPSTREAM_CHECK_PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)/"
35 37
36CVE_PRODUCT ?= "python:${PYPI_PACKAGE}" 38CVE_PRODUCT ?= "python:${PYPI_PACKAGE}"