diff mbox series

[3/4] classes/pypi: rename pypi_package() to pypi_default_package()

Message ID 20260904133610.774110-3-ross.burton@arm.com
State Accepted, archived
Commit 0160953790c2e9c51c146dc1e80d2ee20149e429
Headers show
Series [1/4] python/*: remove spurious CLEANBROKENs | expand

Commit Message

Ross Burton Sept. 4, 2026, 1:36 p.m. UTC
Make it clear that this function returns a default value.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 meta/classes-recipe/pypi.bbclass | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/pypi.bbclass b/meta/classes-recipe/pypi.bbclass
index b42b171e151..eb13ffe7e71 100644
--- a/meta/classes-recipe/pypi.bbclass
+++ b/meta/classes-recipe/pypi.bbclass
@@ -4,7 +4,11 @@ 
 # SPDX-License-Identifier: MIT
 #
 
-def pypi_package(d):
+def pypi_default_package(d):
+    """
+    Return a reasonable guess for the PyPI package name by
+    stripping any python- prefix from PN.
+    """
     bpn = d.getVar('BPN')
     if bpn.startswith('python-'):
         return bpn[7:]
@@ -13,7 +17,7 @@  def pypi_package(d):
     return bpn
 
 # The PyPi package name (defaults to PN without the python3- prefix)
-PYPI_PACKAGE ?= "${@pypi_package(d)}"
+PYPI_PACKAGE ?= "${@pypi_default_package(d)}"
 # The file extension of the source archive
 PYPI_PACKAGE_EXT ?= "tar.gz"
 # An optional prefix for the download file in the case of name collisions