aboutsummaryrefslogtreecommitdiffstats
path: root/testing/py3-dt-schema/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'testing/py3-dt-schema/APKBUILD')
-rw-r--r--testing/py3-dt-schema/APKBUILD56
1 files changed, 45 insertions, 11 deletions
diff --git a/testing/py3-dt-schema/APKBUILD b/testing/py3-dt-schema/APKBUILD
index c5e8efca09b..9627fea3ac8 100644
--- a/testing/py3-dt-schema/APKBUILD
+++ b/testing/py3-dt-schema/APKBUILD
@@ -1,27 +1,61 @@
-# Contributor: Iskren Chernev <iskren.chernev@gmail.com>
-# Maintainer: Iskren Chernev <iskren.chernev@gmail.com>
+# Contributor: Iskren Chernev <me@iskren.info>
+# Maintainer: Iskren Chernev <me@iskren.info>
pkgname=py3-dt-schema
-pkgver=2021.07
+pkgver=2024.04
pkgrel=0
pkgdesc="Devicetree schema tools"
url="https://github.com/devicetree-org/dt-schema"
arch="noarch"
license="BSD-2-Clause"
-depends="python3 py3-ruamel.yaml py3-jsonschema py3-rfc3987"
-makedepends="py3-setuptools py3-setuptools_scm"
+depends="python3 py3-ruamel.yaml py3-jsonschema417 py3-rfc3987 py3-libfdt"
+makedepends="py3-setuptools py3-setuptools_scm py3-wheel py3-gpep517 py3-installer"
+checkdepends="dtc"
+subpackages="$pkgname-pyc"
source="dt-schema-$pkgver.tar.gz::https://github.com/devicetree-org/dt-schema/archive/v$pkgver.tar.gz"
builddir="$srcdir/dt-schema-$pkgver"
+options="net"
-build() {
- SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" python3 setup.py build
+prepare() {
+ default_prepare
+ {
+ find dtschema -name '*.py'
+ find test -name '*.py'
+ find tools -type f
+ } | while read -r file; do
+ sed -i \
+ -e 's/import jsonschema$/import jsonschema417 as jsonschema/' \
+ -e 's/from jsonschema/from jsonschema417/' \
+ "$file"
+ done
+ sed -i 's/jsonschema/jsonschema417/' pyproject.toml
+ # The project uses setuptools_scm, which handles adding the schema
+ # files to the package, but there is no SCM here..
+ {
+ echo '[tools.setuptools.package.find]'
+ echo 'where=["."]'
+ } >> pyproject.toml
+ echo "recursive-include dtschema/*schemas *.yaml" > MANIFEST.in
}
-package() {
- SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" python3 setup.py install --prefix=/usr --root="$pkgdir"
+build() {
+ SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" \
+ gpep517 build-wheel \
+ --wheel-dir .dist \
+ --output-fd 3 3>&1 >&2
}
check() {
- PYTHONPATH=. python3 test/test-dt-validate.py
+ python3 -m venv --clear --without-pip --system-site-packages .testenv
+ .testenv/bin/python3 -m installer .dist/*.whl
+ .testenv/bin/python3 test/test-dt-validate.py
+}
+
+package() {
+ SETUPTOOLS_SCM_PRETEND_VERSION="$pkgver" \
+ python3 -m installer -d "$pkgdir" \
+ .dist/dtschema-*-py3-none-any.whl
}
-sha512sums="fd720d03b0365870298844826e8387d2fb8f052287d199a54377fb50a0070c414705f745a3581e74dad99a8c4e3564b5fe6875473dc13b972396e1f6f27e7571 dt-schema-2021.07.tar.gz"
+sha512sums="
+10d3e997bff72caff4bfe7b5af148eec9628a159f7e133dc6cba3f8e2413d6d4b268492c8d412a9e26c7454bbf8fdac99a326cffcddd747605f68bd72c764a4b dt-schema-2024.04.tar.gz
+"