python3-incremental: improve packaging

Summary of changes:
1. Create a new package: python3-incremental-tests
2. Create a new package: python3-incremental-scripts. This is an optional
package used to update Twisted locally on the command line. The package
requires python3-click. Most, if not all, users don't need this package.
3. There is no longer a circular dependency between python3-twisted and
python3-incremental at build time.
5. python3-incremental ipk package shrinks from 167 KiB to 32 KiB

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Guðni Már Gilbert
2024-07-18 17:23:21 +00:00
committed by Khem Raj
parent 3dbac8240c
commit 084717cb31

View File

@@ -7,13 +7,28 @@ SRC_URI[sha256sum] = "912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c2
inherit pypi python_setuptools_build_meta
RDEPENDS:${PN} += " \
python3-twisted-core \
python3-click \
PACKAGE_BEFORE_PN = "\
${PN}-scripts \
${PN}-tests \
"
FILES:${PN}-scripts = "\
${PYTHON_SITEPACKAGES_DIR}/incremental/update.py \
${PYTHON_SITEPACKAGES_DIR}/incremental/__pycache__/update*.pyc \
"
RDEPENDS:${PN}-scripts = "\
python3-click \
python3-twisted-core \
"
FILES:${PN}-tests = "${PYTHON_SITEPACKAGES_DIR}/incremental/tests"
# The tests require unit testing tool 'trial' from the twisted package
RDEPENDS:${PN}-tests = "\
${PN}-scripts \
python3-twisted \
"
# -native is needed to build python[3]-twisted, however, we need to take steps to
# prevent a circular dependency. The build apparently does not use the part of
# python-incremental which uses python-twisted, so this hack is OK.
RDEPENDS:python3-incremental-native:remove = "python3-twisted-core-native"
BBCLASSEXTEND = "native"