User Tools

Site Tools


oe_yp_python3_recipes

This is an old revision of the document!


Overview

Standards for pypi/setuptools3-based recipes.

pypi.bbclass

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)}"
PYPI_PACKAGE_EXT ?= "tar.gz"

def pypi_src_uri(d):
    package = d.getVar('PYPI_PACKAGE')
    package_ext = d.getVar('PYPI_PACKAGE_EXT')
    pv = d.getVar('PV')
    return 'https://files.pythonhosted.org/packages/source/%s/%s/%s-%s.%s' % (package[0], package, package, pv, package_ext)

PYPI_SRC_URI ?= "${@pypi_src_uri(d)}"

HOMEPAGE ?= "https://pypi.python.org/pypi/${PYPI_PACKAGE}/"
SECTION = "devel/python"
SRC_URI += "${PYPI_SRC_URI}"
S = "${WORKDIR}/${PYPI_PACKAGE}-${PV}"

UPSTREAM_CHECK_URI ?= "https://pypi.org/project/${PYPI_PACKAGE}/"
UPSTREAM_CHECK_REGEX ?= "/${PYPI_PACKAGE}/(?P<pver>(\d+[\.\-_]*)+)/"

Regular stuff

  • SUMMARY
  • LICENSE
  • LIC_FILES_CHKSUM
  • SRC_URI[md5sum]
  • SRC_URI[sha256sum]
  • BBCLASSEXTEND = “native nativesdk”

HOMEPAGE

Not the pypi page:

...
python3-semver_2.8.1.bb:HOMEPAGE = "https://github.com/k-bx/python-semver"
python3-sentry-sdk_0.14.0.bb:HOMEPAGE = "https://github.com/getsentry/sentry-python"
python3-sh_1.12.14.bb:HOMEPAGE = "https://github.com/amoffat/sh"
python3-sijax_0.3.2.bb:HOMEPAGE = "https://github.com/spantaleev/sijax-python"
python3-simpleeval_0.9.10.bb:HOMEPAGE = "https://pypi.org/project/simpleeval/"
...

PYPI_PACKAGE

Unnecessary if:

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)}"

Examples:

python3-asn1crypto_1.3.0.bb:PYPI_PACKAGE = "asn1crypto"
python3-async-timeout_3.0.1.bb:PYPI_PACKAGE = "async-timeout"
...
python3-raven_6.10.0.bb:PYPI_PACKAGE = "raven"
python3-rfc3339-validator_0.1.1.bb:PYPI_PACKAGE = "rfc3339_validator"
python3-rfc3986-validator_0.1.1.bb:PYPI_PACKAGE = "rfc3986_validator"
python3-robotframework-seriallibrary_0.3.1.bb:PYPI_PACKAGE = "robotframework-seriallibrary"
oe_yp_python3_recipes.1592327686.txt.gz · Last modified: 2020/06/16 17:14 by rpjday