OpenEmbedded (Yocto) recipe for Python validators library

75 views Asked by At

I want to include the Python library validators in my OpenEmbedded build. I am working with the Kirkstone release and the latest version of validators is 0.22.0. There is no recpipe, so I added it myself:

inherit pypi

SUMMARY = "Python Data Validation for Humans™"
HOMEPAGE = "https://python-validators.github.io/validators"
LICENSE = "MIT"

LIC_FILES_CHKSUM = "file://LICENSE;md5=fcf28bd09a60e145c3171c531b9e677d"
SRC_URI[sha256sum] = "77b2689b172eeeb600d9605ab86194641670cdb73b60afd577142a9397873370"

BBCLASSEXTEND = "native nativesdk"

The build runs through, but the package is not correctly installed. In /usr/lib/python3.10/site-packages I get the folder UNKNOWN-0.0.0.dist-info, which contains some meta information including the correct license file, but no Python files.

I played around inheriting various Python build system classes, but no success. I noticed that validatoirs' pyproject.toml file mentions setuptools version 61:

[build-system]
requires = ["setuptools>=61"]

While meta-oe-core only contains version 59.5.0 (python3-setuptools_59.5.0.bb).

2

There are 2 answers

1
Ross Burton On

You didn’t actually inherit a class to build the code. Try setuptools_build_meta.

5
Ross Burton On

Your recipe with a slight reordering for style and the inherit of python_setuptools_build_meta works fine:

SUMMARY = "Python Data Validation for Humans™"
HOMEPAGE = "https://python-validators.github.io/validators"
LICENSE = "MIT"

LIC_FILES_CHKSUM = "file://LICENSE;md5=fcf28bd09a60e145c3171c531b9e677d"
SRC_URI[sha256sum] = "77b2689b172eeeb600d9605ab86194641670cdb73b60afd577142a9397873370"

inherit pypi python_setuptools_build_meta

BBCLASSEXTEND = "native nativesdk"
$ oe-pkgdata-util list-pkg-files -p python3-validators

python3-validators:
    /usr/lib/python3.11/site-packages/validators-0.22.0.dist-info/LICENSE
    /usr/lib/python3.11/site-packages/validators-0.22.0.dist-info/METADATA
    /usr/lib/python3.11/site-packages/validators-0.22.0.dist-info/RECORD
    /usr/lib/python3.11/site-packages/validators-0.22.0.dist-info/WHEEL
    /usr/lib/python3.11/site-packages/validators-0.22.0.dist-info/top_level.txt
    /usr/lib/python3.11/site-packages/validators/__init__.py
    /usr/lib/python3.11/site-packages/validators/__pycache__/__init__.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/_extremes.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/between.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/btc_address.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/card.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/country_code.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/domain.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/email.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/hashes.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/hostname.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/iban.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/ip_address.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/length.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/mac_address.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/slug.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/url.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/utils.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/__pycache__/uuid.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/_extremes.py
    /usr/lib/python3.11/site-packages/validators/between.py
    /usr/lib/python3.11/site-packages/validators/btc_address.py
    /usr/lib/python3.11/site-packages/validators/card.py
    /usr/lib/python3.11/site-packages/validators/country_code.py
    /usr/lib/python3.11/site-packages/validators/domain.py
    /usr/lib/python3.11/site-packages/validators/email.py
    /usr/lib/python3.11/site-packages/validators/hashes.py
    /usr/lib/python3.11/site-packages/validators/hostname.py
    /usr/lib/python3.11/site-packages/validators/i18n/__init__.py
    /usr/lib/python3.11/site-packages/validators/i18n/__pycache__/__init__.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/i18n/__pycache__/es.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/i18n/__pycache__/fi.cpython-311.pyc
    /usr/lib/python3.11/site-packages/validators/i18n/es.py
    /usr/lib/python3.11/site-packages/validators/i18n/fi.py
    /usr/lib/python3.11/site-packages/validators/iban.py
    /usr/lib/python3.11/site-packages/validators/ip_address.py
    /usr/lib/python3.11/site-packages/validators/length.py
    /usr/lib/python3.11/site-packages/validators/mac_address.py
    /usr/lib/python3.11/site-packages/validators/slug.py
    /usr/lib/python3.11/site-packages/validators/url.py
    /usr/lib/python3.11/site-packages/validators/utils.py
    /usr/lib/python3.11/site-packages/validators/uuid.py