Needed to create a recipe for diff-cover. Unfortunately, it seems that setup.py is no longer a standard approach (replaced by pyproject.toml), so I couldnt just use the usual inherit setuptools
approach.
Tried various approaches, but finally gone with this: /a/78437670/2244766 (installing a whl using pip).
so my recipe is:
<code>SRC_URI = "https://files.pythonhosted.org/packages/91/c2/6477e1e2124d7234dfb2cd54fb0628e52f251731592c6d18a935c9c7579b/diff_cover-9.0.0-py3-none-any.whl"
SRC_URI[md5sum] = "11d4454368f293c83b28863c64af29e9"
SRC_URI[sha1sum] = "b1fb7a8e66d8f05cc8d2868ba6d5fc29d36c5d1d"
SRC_URI[sha256sum] = "31b308259b79e2cab5f30aff499a3ea3ba9475f0d495d82ba9b6caa7487bca03"
SRC_URI[sha384sum] = "465d03d7ea1c9a1a29d94e805c82e3d8e898f588b3ffa3b6c3ff331469546228c35be2141a21967743d480b9cc491152"
SRC_URI[sha512sum] = "3c1c9685087cec3e0fd1539397a784dff45d0af7d97ed537770a0c0521dfaecbdcb105b9f1ee0dccfd9365e7a800e8741ab51d8d6078715811859b744c3a957b"
<code>SRC_URI = "https://files.pythonhosted.org/packages/91/c2/6477e1e2124d7234dfb2cd54fb0628e52f251731592c6d18a935c9c7579b/diff_cover-9.0.0-py3-none-any.whl"
SRC_URI[md5sum] = "11d4454368f293c83b28863c64af29e9"
SRC_URI[sha1sum] = "b1fb7a8e66d8f05cc8d2868ba6d5fc29d36c5d1d"
SRC_URI[sha256sum] = "31b308259b79e2cab5f30aff499a3ea3ba9475f0d495d82ba9b6caa7487bca03"
SRC_URI[sha384sum] = "465d03d7ea1c9a1a29d94e805c82e3d8e898f588b3ffa3b6c3ff331469546228c35be2141a21967743d480b9cc491152"
SRC_URI[sha512sum] = "3c1c9685087cec3e0fd1539397a784dff45d0af7d97ed537770a0c0521dfaecbdcb105b9f1ee0dccfd9365e7a800e8741ab51d8d6078715811859b744c3a957b"
</code>
SRC_URI = "https://files.pythonhosted.org/packages/91/c2/6477e1e2124d7234dfb2cd54fb0628e52f251731592c6d18a935c9c7579b/diff_cover-9.0.0-py3-none-any.whl"
SRC_URI[md5sum] = "11d4454368f293c83b28863c64af29e9"
SRC_URI[sha1sum] = "b1fb7a8e66d8f05cc8d2868ba6d5fc29d36c5d1d"
SRC_URI[sha256sum] = "31b308259b79e2cab5f30aff499a3ea3ba9475f0d495d82ba9b6caa7487bca03"
SRC_URI[sha384sum] = "465d03d7ea1c9a1a29d94e805c82e3d8e898f588b3ffa3b6c3ff331469546228c35be2141a21967743d480b9cc491152"
SRC_URI[sha512sum] = "3c1c9685087cec3e0fd1539397a784dff45d0af7d97ed537770a0c0521dfaecbdcb105b9f1ee0dccfd9365e7a800e8741ab51d8d6078715811859b744c3a957b"
+
<code>SUMMARY = "Run coverage and linting reports on diffs"
HOMEPAGE = "https://github.com/Bachmann1234/diff_cover"
BBCLASSEXTEND = "native nativesdk"
SRC_URI:append = ";unpack=false"
WHL_BPN="${@ d.getVar('BPN').replace(d.getVar('PYTHON_PN')+'-', '', 1)}"
python3 -m pip install --find-links "${WORKDIR}" "${WHL_BPN}"
<code>SUMMARY = "Run coverage and linting reports on diffs"
HOMEPAGE = "https://github.com/Bachmann1234/diff_cover"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
BBCLASSEXTEND = "native nativesdk"
SRC_URI:append = ";unpack=false"
inherit python3-dir
DEPENDS = "python3-pip"
WHL_BPN="${@ d.getVar('BPN').replace(d.getVar('PYTHON_PN')+'-', '', 1)}"
do_install() {
python3 -m pip install --find-links "${WORKDIR}" "${WHL_BPN}"
}
</code>
SUMMARY = "Run coverage and linting reports on diffs"
HOMEPAGE = "https://github.com/Bachmann1234/diff_cover"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
BBCLASSEXTEND = "native nativesdk"
SRC_URI:append = ";unpack=false"
inherit python3-dir
DEPENDS = "python3-pip"
WHL_BPN="${@ d.getVar('BPN').replace(d.getVar('PYTHON_PN')+'-', '', 1)}"
do_install() {
python3 -m pip install --find-links "${WORKDIR}" "${WHL_BPN}"
}
now the problem: when building “casually” (bitbake python3-diff-cover-native
) it all works (I get all the python files in proper site-packages
, and also the desired “entry point” in usr/bin
. But when using sstate cache – I have nothing.
This can be easily (?) reproduced with:
- build the original recipe in
- make a second workspace (prepare_env…)
echo 'SSTATE_DIR:append = "<workspace1>/build/sstate-cache"' >> conf/local.conf
- build (
bitbake python3-diff-cover-native
)
How to make this work with sstate-cache?