From 3cea38768cccaba13b86f1f2aef635c169e51a09 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sat, 14 Oct 2023 02:14:10 +0800 Subject: [PATCH 1/7] python-rpds-py: Add new package From the README: Python bindings to the Rust rpds crate for persistent data structures. Signed-off-by: Jeffery To --- lang/python/python-rpds-py/Makefile | 43 +++++++++++++++++++++++++++++ lang/python/python-rpds-py/test.sh | 21 ++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 lang/python/python-rpds-py/Makefile create mode 100644 lang/python/python-rpds-py/test.sh diff --git a/lang/python/python-rpds-py/Makefile b/lang/python/python-rpds-py/Makefile new file mode 100644 index 00000000000000..c2aef8452f70e9 --- /dev/null +++ b/lang/python/python-rpds-py/Makefile @@ -0,0 +1,43 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-rpds-py +PKG_VERSION:=0.10.6 +PKG_RELEASE:=1 + +PYPI_NAME:=rpds-py +PYPI_SOURCE_NAME:=rpds_py +PKG_HASH:=4ce5a708d65a8dbf3748d2474b580d606b1b9f91b5c6ab2a316e0b0cf7a4ba50 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-maturin/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-rpds-py + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Bindings to Rust's persistent data structures + URL:=https://github.com/crate-py/rpds + DEPENDS:=+python3-light $(RUST_ARCH_DEPENDS) +endef + +define Package/python3-rpds-py/description +Python bindings to the Rust rpds crate for persistent data structures. +endef + +$(eval $(call Py3Package,python3-rpds-py)) +$(eval $(call BuildPackage,python3-rpds-py)) +$(eval $(call BuildPackage,python3-rpds-py-src)) diff --git a/lang/python/python-rpds-py/test.sh b/lang/python/python-rpds-py/test.sh new file mode 100644 index 00000000000000..d5dec8f5f43a01 --- /dev/null +++ b/lang/python/python-rpds-py/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +[ "$1" = python3-rpds-py ] || exit 0 + +python3 - << 'EOF' + +from rpds import HashTrieMap, HashTrieSet, List + +m = HashTrieMap({"foo": "bar", "baz": "quux"}) +assert m.insert("spam", 37) == HashTrieMap({"foo": "bar", "baz": "quux", "spam": 37}) +assert m.remove("foo") == HashTrieMap({"baz": "quux"}) + +s = HashTrieSet({"foo", "bar", "baz", "quux"}) +assert s.insert("spam") == HashTrieSet({"foo", "bar", "baz", "quux", "spam"}) +assert s.remove("foo") == HashTrieSet({"bar", "baz", "quux"}) + +L = List([1, 3, 5]) +assert L.push_front(-1) == List([-1, 1, 3, 5]) +assert L.rest == List([3, 5]) + +EOF From e9c97983bd7829f7714d89f9e7d61d92453d8136 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sat, 14 Oct 2023 02:27:02 +0800 Subject: [PATCH 2/7] python-referencing: Add new package From the README: An implementation-agnostic implementation of JSON reference resolution. Signed-off-by: Jeffery To --- lang/python/python-referencing/Makefile | 47 +++++++++++++++++++++++++ lang/python/python-referencing/test.sh | 35 ++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 lang/python/python-referencing/Makefile create mode 100644 lang/python/python-referencing/test.sh diff --git a/lang/python/python-referencing/Makefile b/lang/python/python-referencing/Makefile new file mode 100644 index 00000000000000..05f184a5513011 --- /dev/null +++ b/lang/python/python-referencing/Makefile @@ -0,0 +1,47 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-referencing +PKG_VERSION:=0.30.2 +PKG_RELEASE:=1 + +PYPI_NAME:=referencing +PKG_HASH:=794ad8003c65938edcdbc027f1933215e0d0ccc0291e3ce20a4d87432b59efc0 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-referencing + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=JSON Referencing + Python + URL:=https://github.com/python-jsonschema/referencing + DEPENDS:= \ + +python3-light \ + +python3-email \ + +python3-urllib \ + +python3-attrs \ + +python3-rpds-py +endef + +define Package/python3-referencing/description +An implementation-agnostic implementation of JSON reference resolution. +endef + +$(eval $(call Py3Package,python3-referencing)) +$(eval $(call BuildPackage,python3-referencing)) +$(eval $(call BuildPackage,python3-referencing-src)) diff --git a/lang/python/python-referencing/test.sh b/lang/python/python-referencing/test.sh new file mode 100644 index 00000000000000..0517ba16877607 --- /dev/null +++ b/lang/python/python-referencing/test.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +[ "$1" = python3-referencing ] || exit 0 + +python3 - << 'EOF' + +from referencing import Registry, Resource +import referencing.jsonschema + +schema = Resource.from_contents( # Parse some contents into a 2020-12 JSON Schema + { + "$schema": "https://json-schema.org/draft/2020-12/schema", + "$id": "urn:example:a-202012-schema", + "$defs": { + "nonNegativeInteger": { + "$anchor": "nonNegativeInteger", + "type": "integer", + "minimum": 0, + }, + }, + } +) +registry = schema @ Registry() # Add the resource to a new registry + +# From here forward, this would usually be done within a library wrapping this one, +# like a JSON Schema implementation +resolver = registry.resolver() +resolved = resolver.lookup("urn:example:a-202012-schema#nonNegativeInteger") +assert resolved.contents == { + "$anchor": "nonNegativeInteger", + "type": "integer", + "minimum": 0, +} + +EOF From e491977cbf287449b61b49066992fcfd46601f28 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sat, 14 Oct 2023 02:30:53 +0800 Subject: [PATCH 3/7] python-jsonschema-specifications: Add new package From the README: JSON support files from the JSON Schema Specifications (metaschemas, vocabularies, etc.), packaged for runtime access from Python as a referencing-based Schema Registry. Signed-off-by: Jeffery To --- .../python-jsonschema-specifications/Makefile | 45 +++++++++++++++++++ .../python-jsonschema-specifications/test.sh | 12 +++++ 2 files changed, 57 insertions(+) create mode 100644 lang/python/python-jsonschema-specifications/Makefile create mode 100644 lang/python/python-jsonschema-specifications/test.sh diff --git a/lang/python/python-jsonschema-specifications/Makefile b/lang/python/python-jsonschema-specifications/Makefile new file mode 100644 index 00000000000000..88cc0ba32d8d30 --- /dev/null +++ b/lang/python/python-jsonschema-specifications/Makefile @@ -0,0 +1,45 @@ +# +# Copyright (C) 2023 Jeffery To +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=python-jsonschema-specifications +PKG_VERSION:=2023.7.1 +PKG_RELEASE:=1 + +PYPI_NAME:=jsonschema-specifications +PYPI_SOURCE_NAME:=jsonschema_specifications +PKG_HASH:=c91a50404e88a1f6ba40636778e2ee08f6e24c5613fe4c53ac24578a5a7f72bb + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=COPYING +PKG_MAINTAINER:=Jeffery To + +PKG_BUILD_DEPENDS:=python-hatchling/host python-hatch-vcs/host + +include ../pypi.mk +include $(INCLUDE_DIR)/package.mk +include ../python3-package.mk + +define Package/python3-jsonschema-specifications + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=JSON Schema meta-schemas and vocabularies + URL:=https://github.com/python-jsonschema/jsonschema-specifications + DEPENDS:=+python3-light +python3-referencing +endef + +define Package/python3-jsonschema-specifications/description +JSON support files from the JSON Schema Specifications (metaschemas, +vocabularies, etc.), packaged for runtime access from Python as a +referencing-based Schema Registry. +endef + +$(eval $(call Py3Package,python3-jsonschema-specifications)) +$(eval $(call BuildPackage,python3-jsonschema-specifications)) +$(eval $(call BuildPackage,python3-jsonschema-specifications-src)) diff --git a/lang/python/python-jsonschema-specifications/test.sh b/lang/python/python-jsonschema-specifications/test.sh new file mode 100644 index 00000000000000..cdf2f5710400b2 --- /dev/null +++ b/lang/python/python-jsonschema-specifications/test.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +[ "$1" = python3-jsonschema-specifications ] || exit 0 + +python3 - << 'EOF' + +from jsonschema_specifications import REGISTRY as SPECIFICATIONS + +DRAFT202012_DIALECT_URI = "https://json-schema.org/draft/2020-12/schema" +assert SPECIFICATIONS.contents(DRAFT202012_DIALECT_URI) != "" + +EOF From 98ae71b1d755a9906711833af8d56917bc5de2bf Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Sat, 14 Oct 2023 02:34:23 +0800 Subject: [PATCH 4/7] python-jsonschema: Update to 4.19.1, update list of dependencies This also adds a test.sh script for the packages feed CI. Signed-off-by: Jeffery To --- lang/python/python-jsonschema/Makefile | 19 +++++++++++++------ lang/python/python-jsonschema/test.sh | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 lang/python/python-jsonschema/test.sh diff --git a/lang/python/python-jsonschema/Makefile b/lang/python/python-jsonschema/Makefile index 4c6e44d4680c7a..4e3b9c7e41818a 100644 --- a/lang/python/python-jsonschema/Makefile +++ b/lang/python/python-jsonschema/Makefile @@ -1,11 +1,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-jsonschema -PKG_VERSION:=4.17.3 -PKG_RELEASE:=3 +PKG_VERSION:=4.19.1 +PKG_RELEASE:=1 PYPI_NAME:=jsonschema -PKG_HASH:=0f864437ab8b6076ba6707453ef8f98a6a0d512a80e93f8abdb676f737ecb60d +PKG_HASH:=ec84cc37cfa703ef7cd4928db24f9cb31428a5d0fa77747b8b51a847458e0bbf PKG_MAINTAINER:=Javier Marcet PKG_LICENSE:=MIT @@ -22,9 +22,16 @@ define Package/python3-jsonschema CATEGORY:=Languages SUBMENU:=Python TITLE:=An implementation of JSON Schema validation - URL:=https://github.com/Julian/jsonschema - DEPENDS:=+python3-light +python3-attrs +python3-urllib \ - +python3-six +python3-pyrsistent +python3-setuptools + URL:=https://github.com/python-jsonschema/jsonschema + DEPENDS:= \ + +python3-light \ + +python3-decimal \ + +python3-urllib \ + +python3-uuid \ + +python3-attrs \ + +python3-jsonschema-specifications \ + +python3-referencing \ + +python3-rpds-py endef define Package/python3-jsonschema/description diff --git a/lang/python/python-jsonschema/test.sh b/lang/python/python-jsonschema/test.sh new file mode 100644 index 00000000000000..37fe4925a9056f --- /dev/null +++ b/lang/python/python-jsonschema/test.sh @@ -0,0 +1,21 @@ +#!/bin/sh + +[ "$1" = python3-jsonschema ] || exit 0 + +python3 - << 'EOF' + +from jsonschema import validate + +# A sample schema, like what we'd get from json.load() +schema = { + "type" : "object", + "properties" : { + "price" : {"type" : "number"}, + "name" : {"type" : "string"}, + }, +} + +# If no exception is raised by validate(), the instance is valid. +validate(instance={"name" : "Eggs", "price" : 34.99}, schema=schema) + +EOF From 9292960015a51248fff168c52df30717ff5aef25 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 17 Oct 2023 01:00:55 +0800 Subject: [PATCH 5/7] use my own action, always store logs, only riscv64, bloop --- .github/workflows/multi-arch-test-build.yml | 43 +++------------------ 1 file changed, 6 insertions(+), 37 deletions(-) diff --git a/.github/workflows/multi-arch-test-build.yml b/.github/workflows/multi-arch-test-build.yml index 57182b96b65fe8..d227e61eba18e4 100644 --- a/.github/workflows/multi-arch-test-build.yml +++ b/.github/workflows/multi-arch-test-build.yml @@ -15,46 +15,10 @@ jobs: fail-fast: false matrix: include: - - arch: aarch64_generic - target: armsr-armv8 - runtime_test: true - - - arch: arm_cortex-a15_neon-vfpv4 - target: armsr-armv7 - runtime_test: true - - - arch: arm_cortex-a9_vfpv3-d16 - target: mvebu-cortexa9 - runtime_test: false - - - arch: i386_pentium-mmx - target: x86-geode - runtime_test: true - - - arch: mips_24kc - target: ath79-generic - runtime_test: true - - - arch: mipsel_24kc - target: mt7621 - runtime_test: false - - - arch: powerpc_464fp - target: apm821xx-nand - runtime_test: false - - - arch: powerpc_8548 - target: mpc85xx-p1010 - runtime_test: false - - arch: riscv64_riscv64 target: sifiveu-generic runtime_test: false - - arch: x86_64 - target: x86-64 - runtime_test: true - steps: - uses: actions/checkout@v3 with: @@ -101,7 +65,7 @@ jobs: echo "$EOF" >> $GITHUB_ENV - name: Build - uses: openwrt/gh-action-sdk@v5 + uses: jefferyto/openwrt-gh-action-sdk@no-j1 env: ARCH: ${{ matrix.arch }}-${{ env.BRANCH }} FEEDNAME: packages_ci @@ -109,9 +73,11 @@ jobs: KEY_BUILD: ${{ env.KEY_BUILD }} - name: Move created packages to project dir + if: always() run: cp bin/packages/${{ matrix.arch }}/packages_ci/* . || true - name: Collect metadata + if: always() run: | MERGE_ID=$(git rev-parse --short HEAD) echo "MERGE_ID=$MERGE_ID" >> $GITHUB_ENV @@ -122,6 +88,7 @@ jobs: echo "ARCHIVE_NAME=${{matrix.arch}}-PR$PRNUMBER-$MERGE_ID" >> $GITHUB_ENV - name: Generate metadata + if: always() run: | cat << _EOF_ > PKG-INFO Metadata-Version: 2.1 @@ -148,6 +115,7 @@ jobs: cat PKG-INFO - name: Store packages + if: always() uses: actions/upload-artifact@v3 with: name: ${{env.ARCHIVE_NAME}}-packages @@ -158,6 +126,7 @@ jobs: PKG-INFO - name: Store logs + if: always() uses: actions/upload-artifact@v3 with: name: ${{env.ARCHIVE_NAME}}-logs From 86601c5a17ed56ee6f8908c85d614d1b3d300c5a Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 17 Oct 2023 12:58:42 +0800 Subject: [PATCH 6/7] add back some more archs --- .github/workflows/multi-arch-test-build.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/multi-arch-test-build.yml b/.github/workflows/multi-arch-test-build.yml index d227e61eba18e4..2f6f0e18bf2986 100644 --- a/.github/workflows/multi-arch-test-build.yml +++ b/.github/workflows/multi-arch-test-build.yml @@ -15,10 +15,30 @@ jobs: fail-fast: false matrix: include: + - arch: aarch64_generic + target: armsr-armv8 + runtime_test: false + + - arch: arm_cortex-a15_neon-vfpv4 + target: armsr-armv7 + runtime_test: false + - arch: riscv64_riscv64 target: sifiveu-generic runtime_test: false + - arch: i386_pentium-mmx + target: x86-geode + runtime_test: false + + - arch: mips_24kc + target: ath79-generic + runtime_test: false + + - arch: x86_64 + target: x86-64 + runtime_test: false + steps: - uses: actions/checkout@v3 with: From 534de7692520c73bf57257671bf35b9927e1695b Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Tue, 17 Oct 2023 13:00:50 +0800 Subject: [PATCH 7/7] show disk usage --- .github/workflows/multi-arch-test-build.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/multi-arch-test-build.yml b/.github/workflows/multi-arch-test-build.yml index 2f6f0e18bf2986..23ef4f7a2cbae0 100644 --- a/.github/workflows/multi-arch-test-build.yml +++ b/.github/workflows/multi-arch-test-build.yml @@ -84,6 +84,10 @@ jobs: cat packages_ci.sec >> $GITHUB_ENV echo "$EOF" >> $GITHUB_ENV + - name: Show disk usage before build + run: | + df -h + - name: Build uses: jefferyto/openwrt-gh-action-sdk@no-j1 env: @@ -92,6 +96,10 @@ jobs: INDEX: 1 KEY_BUILD: ${{ env.KEY_BUILD }} + - name: Show disk usage after build + run: | + df -h + - name: Move created packages to project dir if: always() run: cp bin/packages/${{ matrix.arch }}/packages_ci/* . || true