I'm trying to create a Bitbake recipe which imports the Clickhouse python library. I'm following the example set in this post. I have a unique problem in that the name of the recipe is very sensitive to underscores, and this seems to cause significant issues on the do_compile/do_fetch steps. The name of the compressed library is clickhouse_connect-0.8.18.tar.gz. By the yocto naming convention, the name should be something like python3-clickhouse-custom_0.8.18. When pypi searches for a url associated with that filename, it comes up with nothing because the underscore in the middle of the line is replaced with a dash. I cannot replace the dash because the "connect" part of the name is in the "version" place.
Here is the file setup:
python3-clickhouse-connect_0.8.18.inc
DESCRIPTION = "Clickhouse Integration for Python3"
SECTION = "devel/python"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
SRC_URI = "https://files.pythonhosted.org/packages/2a/3d/a06d938d1efb94fdf8a343bbe1dc4ad2458aef08b9c69e0080d695ab24c1/clickhouse_connect-0.8.18.tar.gz;downloadfilename=clickhouse_connect-0.8.18.tar.gz"
SRC_URI[md5sum] = "5996416b9102e4b18b9e492f886f1aa9"
SRC_URI[sha256sum] = "206a33decf2d9ed689d3156ef906dc06f1db7eabfe512e3552e08e9e86b4c73a"
S = "${WORKDIR}/clickhouse-connect-0.8.18"
RDEPENDS_${PN} = ""
python3-clickhouse-connect_0.8.18.bb
require python3-clickhouse-connect_0.8.18.inc
inherit setuptools3
I first tried replacing the SRC_URI parameter with the actual URL of the device. Pypi overrides this when it runs and replaces it with the expectation from the file name of the .bb file.
I tried removing pypi and all the package index information and just using the SRC_URI. Although this successfully pulled the file from the URL, it fails on the do_compile step because the setup.py cannot be found.
| DEBUG: Executing shell function do_compile
| /home/$USER/yocto/toradex/build/tmp/work/armv8a-tdx-linux/python3-clickhouse-connect/0.8.18/recipe-sysroot-native/usr/bin/python3-native/python3: can't open file '/home/$USER/yocto/toradex/build/tmp/work/armv8a-tdx-linux/python3-clickhouse-connect/0.8.18/clickhouse-connect-0.8.18/setup.py': [Errno 2] No such file or directory
| ERROR: 'python3 setup.py bdist_wheel ' execution failed.
| WARNING: exit code 1 from a shell command.
I think the cause of the above is that the unzipped package name includes the incorrect name based on the Yocto naming convention. It gets parsed into the folder structure incorrectly. I'm fairly new to Yocto and didn't know how to trace back the actual locations of these directories at runtime.
There are some errors in the recipe you created:
To help, I have the python3-clickhouse-connect_0.8.18.bb recipe, which I even used with the Toradex module:
DESCRIPTION = "Clickhouse Integration for Python3"
SECTION = "devel/python"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=72748b55a8f913c2f5922dc8ed95a9cc"
SRC_URI[sha256sum] = "206a33decf2d9ed689d3156ef906dc06f1db7eabfe512e3552e08e9e86b4c73a"
PYPI_PACKAGE = "clickhouse_connect"
inherit pypi setuptools3