numerous superfluous PYPI_PACKAGE assignments in meta-python?


Robert P. J. Day
 

in aid of docs, currently poring over python-based recipes to
document how one builds python recipe files, and noticed that numerous
recipe files contain an assignment of the form:

python3-smbus2_0.3.0.bb:PYPI_PACKAGE = "smbus2"

which seems superfluous given that pypi.bbclass contains:

def pypi_package(d):
bpn = d.getVar('BPN')
if bpn.startswith('python-'):
return bpn[7:]
elif bpn.startswith('python3-'):
return bpn[8:]
return bpn

PYPI_PACKAGE ?= "${@pypi_package(d)}"

clearly harmless but, in the above example, unnecessary, no?

there are, of course, numerous recipes that require an assignment of
that form as the actual PyPI package name is some annoying variation,
such as:

python3-sqlalchemy_1.3.12.bb:PYPI_PACKAGE = "SQLAlchemy"
python3-websocket-client_0.56.0.bb:PYPI_PACKAGE = "websocket_client"
python-django-south.inc:PYPI_PACKAGE = "South"

and so on, i just want to be able to write that as long as the recipe
file name *exactly* matches the PyPI package name, that assignment is
unnecessary. (i'm a minimalist.)

rday

p.s. on that note, i was curious about the recipe file
python3-twitter_3.8.0.bb, which contained the line:

PYPI_PACKAGE = "tweepy"

under the circumstances, why not have just named the recipe file
python3-tweepy...?

Join yocto@lists.yoctoproject.org to automatically receive all group messages.