Skip to contentSkip to conversation

package/python-cramjam: new package

PATCH RESEND In review Flaviu Nistor 2 participants 10 messages Oct 2 – Oct 15

lore
Share & tools
lore
#0 lore raw

PATCH RESEND v4 1/3 package/python-cramjam: new package

Add cramjam, a python bindings to de/compression algorithms. It is needed by python-snappy package in order to bump the version.

---
Changes in v4:
- Update also DEVELOPERS file as suggested by Fiona Klute.
- Link to v3: https://lore.kernel.org/all/[email protected]/

 DEVELOPERS                                 |  3 +++
 package/Config.in                          |  1 +
 package/python-cramjam/Config.in           |  9 +++++++++
 package/python-cramjam/python-cramjam.hash |  4 ++++
 package/python-cramjam/python-cramjam.mk   | 14 ++++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 package/python-cramjam/Config.in
 create mode 100644 package/python-cramjam/python-cramjam.hash
 create mode 100644 package/python-cramjam/python-cramjam.mk
DEVELOPERS +3 -0
index f2713c7239..93519574c9 100644
@@ -1134,6 +1134,9 @@ F:	support/testing/tests/package/test_nftables.py
 F:	support/testing/tests/package/test_python_networkmanager_goi.py
 F:	support/testing/tests/package/test_python_pyroute2.py
 
+N:	Flaviu Nistor <[email protected]>
+F:	package/python-cramjam/
+
 N:	Flávio Tapajós <[email protected]>
 F:	configs/asus_tinker-s_rk3288_defconfig
 F:	board/asus/tinker-s/
package/Config.in +1 -0
index fc1e57d30d..d4e3c2fe58 100644
@@ -1061,6 +1061,7 @@ menu "External python modules"
 	source "package/python-construct/Config.in"
 	source "package/python-contourpy/Config.in"
 	source "package/python-couchdb/Config.in"
+	source "package/python-cramjam/Config.in"
 	source "package/python-crayons/Config.in"
 	source "package/python-crc/Config.in"
 	source "package/python-crc16/Config.in"
package/python-cramjam/Config.in new file +9 -0
new file mode 100644
index 0000000000..84119ca968
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_CRAMJAM
+	bool "python-cramjam"
+	depends on !BR2_ARM_CPU_ARMV5
+	help
+	  Python bindings to de/compression algorithms in Rust.
+	  Allows for using algorithms such as Snappy, without any
+	  system or other python dependencies.
+
+	  https://pypi.org/project/cramjam
package/python-cramjam/python-cramjam.hash new file +4 -0
new file mode 100644
index 0000000000..2042bb6281
@@ -0,0 +1,4 @@
+# Locally computed sha256 checksums
+sha256  542ea349a7528d88935856d3eb562cd17bff713d7a41eab8d6812d78a3cb00ba  cramjam-2.11.0.tar.gz
+sha256  10892f279948fe9a2dd5f2c559ef78aae1ebf4b5d5825e1eaf68b03787fde402  python-cramjam-2.11.0-cargo6.tar.gz
+sha256  b4f882bfc80d27a3732789bd883a8c1d342e8ffea7f622a71b3dfded834205ff  LICENSE
package/python-cramjam/python-cramjam.mk new file +14 -0
new file mode 100644
index 0000000000..e1e060bfba
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-cramjam
+#
+################################################################################
+
+PYTHON_CRAMJAM_VERSION = 2.11.0
+PYTHON_CRAMJAM_SITE = $(call github,milesgranger,cramjam,v$(PYTHON_CRAMJAM_VERSION))
+PYTHON_CRAMJAM_SETUP_TYPE = maturin
+PYTHON_CRAMJAM_LICENSE = MIT
+PYTHON_CRAMJAM_LICENSE_FILES = LICENSE
+
+$(eval $(python-package))
+$(eval $(host-python-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

PATCH RESEND v4 2/3 package/python-snappy: bump version to 0.7.2

Even if there is a 0.7.3 on Pypi, there is no 0.7.3 release on the project homepage, hence the bump to 0.7.2. Since 0.7.0 is switched from snappy library to cramjam so update the PYTHON_SNAPPY_DEPENDENCIES.
Add also PYTHON_SNAPPY_SOURCE for correct package on Pypi.

---
Changes in v4:
- Add also tests for python-snappy as indicated by Julien Olivain.
- More clean package Config.in
- Link to v3: https://lore.kernel.org/all/[email protected]/
Changes in v3:
- Add new package cramjam and to fix error indicated by Julien Olivain.
- Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Fix error indicated by Julien Olivain when running make python-snappy-legal-info.
- Link to v1: https://lore.kernel.org/all/[email protected]/

 DEVELOPERS                               | 4 ++++
 package/python-snappy/Config.in          | 7 ++-----
 package/python-snappy/python-snappy.hash | 4 ++--
 package/python-snappy/python-snappy.mk   | 7 ++++---
 4 files changed, 12 insertions(+), 10 deletions(-)
DEVELOPERS +4 -0
index 93519574c9..dbe05b7806 100644
@@ -1135,7 +1135,11 @@ F:	support/testing/tests/package/test_python_networkmanager_goi.py
 F:	support/testing/tests/package/test_python_pyroute2.py
 
 N:	Flaviu Nistor <[email protected]>
+F:	package/python-click/
 F:	package/python-cramjam/
+F:	package/python-rich/
+F:	package/python-smmap2/
+F:	package/python-snappy/
 
 N:	Flávio Tapajós <[email protected]>
 F:	configs/asus_tinker-s_rk3288_defconfig
package/python-snappy/Config.in +2 -5
index fd7f84050f..e13c6abadb 100644
@@ -1,12 +1,9 @@
 config BR2_PACKAGE_PYTHON_SNAPPY
 	bool "python-snappy"
-	depends on BR2_INSTALL_LIBSTDCPP # snappy
-	select BR2_PACKAGE_SNAPPY
+	depends on !BR2_ARM_CPU_ARMV5	#cramjam
+	select BR2_PACKAGE_PYTHON_CRAMJAM
 	help
 	  Python library for the snappy compression library from
 	  Google.
 
 	  http://github.com/andrix/python-snappy
-
-comment "python-snappy needs a toolchain w/ C++"
-	depends on !BR2_INSTALL_LIBSTDCPP
package/python-snappy/python-snappy.hash +2 -2
index c4dbc72077..2f40b6c531 100644
@@ -1,5 +1,5 @@
 # md5, sha256 from https://pypi.org/pypi/python-snappy/json
-md5  fc84cfa3526fba06d66f0d0b2e764300  python-snappy-0.6.1.tar.gz
-sha256  b6a107ab06206acc5359d4c5632bd9b22d448702a79b3169b0c62e0fb808bb2a  python-snappy-0.6.1.tar.gz
+md5  04a4e58b0a932403bb285900e67c778d  python_snappy-0.7.2.tar.gz
+sha256  04bf182f9d9f67b7a846dae2f1df36180ceeee8d3380e4b6799deff5272c4978  python_snappy-0.7.2.tar.gz
 # Locally computed sha256 checksums
 sha256  d007cb05f143d99d16d5cd0d1bf291daf037adb36800344e440ec26edb938f9a  LICENSE
package/python-snappy/python-snappy.mk +4 -3
index e80aa861df..5d34b6d493 100644
@@ -4,11 +4,12 @@
 #
 ################################################################################
 
-PYTHON_SNAPPY_VERSION = 0.6.1
-PYTHON_SNAPPY_SITE = https://files.pythonhosted.org/packages/98/7a/44a24bad98335b2c72e4cadcdecf79f50197d1bab9f22f863a274f104b96
+PYTHON_SNAPPY_VERSION = 0.7.2
+PYTHON_SNAPPY_SOURCE = python_snappy-$(PYTHON_SNAPPY_VERSION).tar.gz
+PYTHON_SNAPPY_SITE = https://files.pythonhosted.org/packages/cb/52/acd87583175fa930e4385f8a6164eb5909acd683c0e62ee01d41de8195a2
 PYTHON_SNAPPY_SETUP_TYPE = setuptools
 PYTHON_SNAPPY_LICENSE = BSD-3-Clause
 PYTHON_SNAPPY_LICENSE_FILES = LICENSE
-PYTHON_SNAPPY_DEPENDENCIES = snappy
+PYTHON_SNAPPY_DEPENDENCIES = host-python-cramjam python-cramjam
 
 $(eval $(python-package))
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH v4 RESEND 2/3] package/python-snappy: bump version to 0.7.2

Quoted 4 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Flaviu" == Flaviu Nistor <[email protected]> writes:

Even if there is a 0.7.3 on Pypi, there is no 0.7.3 release on the project homepage, hence the bump to 0.7.2.

How about contacting the author about the 0.7.3 tag?

Quoted 28 lines

Since 0.7.0 is switched from snappy library to cramjam so update the PYTHON_SNAPPY_DEPENDENCIES.
Add also PYTHON_SNAPPY_SOURCE for correct package on Pypi.

---
Changes in v4:
- Add also tests for python-snappy as indicated by Julien Olivain.
- More clean package Config.in
- Link to v3: https://lore.kernel.org/all/[email protected]/
Changes in v3:
- Add new package cramjam and to fix error indicated by Julien Olivain.
- Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Fix error indicated by Julien Olivain when running make python-snappy-legal-info.
- Link to v1: https://lore.kernel.org/all/[email protected]/

 DEVELOPERS                               | 4 ++++
 package/python-snappy/Config.in          | 7 ++-----
 package/python-snappy/python-snappy.hash | 4 ++--
 package/python-snappy/python-snappy.mk   | 7 ++++---
 4 files changed, 12 insertions(+), 10 deletions(-)
DEVELOPERS +0 -0
index 93519574c9..dbe05b7806 100644

DEVELOPERS F: support/testing/tests/package/test_python_networkmanager_goi.py · line 1142

Quoted 8 lines
DEVELOPERS +4 -0
@@ -1135,7 +1135,11 @@ F:	support/testing/tests/package/test_python_networkmanager_goi.py
 F:	support/testing/tests/package/test_python_pyroute2.py
 
 N:	Flaviu Nistor <[email protected]>
+F:	package/python-click/
 F:	package/python-cramjam/
+F:	package/python-rich/
+F:	package/python-smmap2/
+F:	package/python-snappy/

It is good that you add yourself to DEVELOPERS, but the click/rich/smmap2 additions belong in a separate commit.

DEVELOPERS F: support/testing/tests/package/test_python_networkmanager_goi.py

Quoted 10 lines
DEVELOPERS +4 -3
-PYTHON_SNAPPY_VERSION = 0.6.1
-PYTHON_SNAPPY_SITE = https://files.pythonhosted.org/packages/98/7a/44a24bad98335b2c72e4cadcdecf79f50197d1bab9f22f863a274f104b96
+PYTHON_SNAPPY_VERSION = 0.7.2
+PYTHON_SNAPPY_SOURCE = python_snappy-$(PYTHON_SNAPPY_VERSION).tar.gz
+PYTHON_SNAPPY_SITE = https://files.pythonhosted.org/packages/cb/52/acd87583175fa930e4385f8a6164eb5909acd683c0e62ee01d41de8195a2
 PYTHON_SNAPPY_SETUP_TYPE = setuptools
 PYTHON_SNAPPY_LICENSE = BSD-3-Clause
 PYTHON_SNAPPY_LICENSE_FILES = LICENSE
-PYTHON_SNAPPY_DEPENDENCIES = snappy
+PYTHON_SNAPPY_DEPENDENCIES = host-python-cramjam python-cramjam

Why do we need host-python-cramjam? Please describe that in the commit message.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Re: [Buildroot] [PATCH v4 RESEND 2/3] package/python-snappy: bump version to 0.7.2

Quoted 4 lines · Peter Korsgaard
Quoted 2 lines

Even if there is a 0.7.3 on Pypi, there is no 0.7.3 release on the project homepage, hence the bump to 0.7.2.

How about contacting the author about the 0.7.3 tag?

I will try to contact. In previous situations when I send out a bump it was indicated that I should use a Pypi release only if the tag is released also on the repo. I think also in this case is better to have the bump to 0.7.2 until 0.7.3 is released in the maintainer repo.

Quoted 31 lines
Quoted 30 lines

Since 0.7.0 is switched from snappy library to cramjam so update the PYTHON_SNAPPY_DEPENDENCIES.
Add also PYTHON_SNAPPY_SOURCE for correct package on Pypi.

---
Changes in v4:
- Add also tests for python-snappy as indicated by Julien Olivain.
- More clean package Config.in
- Link to v3: https://lore.kernel.org/all/[email protected]/
Changes in v3:
- Add new package cramjam and to fix error indicated by Julien Olivain.
- Link to v2: https://lore.kernel.org/all/[email protected]/
Changes in v2:
- Fix error indicated by Julien Olivain when running make python-snappy-legal-info.
- Link to v1: https://lore.kernel.org/all/[email protected]/

 DEVELOPERS                               | 4 ++++
 package/python-snappy/Config.in          | 7 ++-----
 package/python-snappy/python-snappy.hash | 4 ++--
 package/python-snappy/python-snappy.mk   | 7 ++++---
 4 files changed, 12 insertions(+), 10 deletions(-)
DEVELOPERS +0 -0
index 93519574c9..dbe05b7806 100644
@@ -1135,7 +1135,11 @@ F:	support/testing/tests/package/test_python_networkmanager_goi.py
 F:	support/testing/tests/package/test_python_pyroute2.py
Quoted 10 lines

DEVELOPERS F: support/testing/tests/package/test_python_networkmanager_goi.py · line 1142

Quoted 6 lines
DEVELOPERS +4 -0
 N:	Flaviu Nistor <[email protected]>
+F:	package/python-click/
 F:	package/python-cramjam/
+F:	package/python-rich/
+F:	package/python-smmap2/
+F:	package/python-snappy/

It is good that you add yourself to DEVELOPERS, but the click/rich/smmap2 additions belong in a separate commit.

I just wanted to avoid some "noise" caused by separate patch, but yes, you are right this would be the better approach. I will change this in v5.

Quoted 4 lines
Quoted 4 lines
DEVELOPERS +2 -2
-PYTHON_SNAPPY_VERSION = 0.6.1
-PYTHON_SNAPPY_SITE = https://files.pythonhosted.org/packages/98/7a/44a24bad98335b2c72e4cadcdecf79f50197d1bab9f22f863a274f104b96
+PYTHON_SNAPPY_VERSION = 0.7.2
+PYTHON_SNAPPY_SOURCE = python_snappy-$(PYTHON_SNAPPY_VERSION).tar.gz
Quoted 8 lines

DEVELOPERS F: support/testing/tests/package/test_python_networkmanager_goi.py

Quoted 6 lines
DEVELOPERS +2 -1
+PYTHON_SNAPPY_SITE = https://files.pythonhosted.org/packages/cb/52/acd87583175fa930e4385f8a6164eb5909acd683c0e62ee01d41de8195a2
 PYTHON_SNAPPY_SETUP_TYPE = setuptools
 PYTHON_SNAPPY_LICENSE = BSD-3-Clause
 PYTHON_SNAPPY_LICENSE_FILES = LICENSE
-PYTHON_SNAPPY_DEPENDENCIES = snappy
+PYTHON_SNAPPY_DEPENDENCIES = host-python-cramjam python-cramjam

Why do we need host-python-cramjam? Please describe that in the commit message.

This is a setup_requires in the setup.py (cramjam>=2.6.0). There is a build fail without it. I will describe in the v5 commit message.
Thanks,
Flaviu

Quoted 3 lines
Signature · 2 lines
-- 
Bye, Peter Korsgaard

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#4 lore raw

Re: [Buildroot] [PATCH v4 RESEND 2/3] package/python-snappy: bump version to 0.7.2

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Flaviu" == Flaviu Nistor <[email protected]> writes:

Quoted 3 lines · Peter Korsgaard
Quoted 2 lines

Even if there is a 0.7.3 on Pypi, there is no 0.7.3 release on the project homepage, hence the bump to 0.7.2.

Quoted 6 lines
Quoted 1 line

How about contacting the author about the 0.7.3 tag?

I will try to contact. In previous situations when I send out a bump it was indicated that I should use a Pypi release only if the tag is released also on the repo. I think also in this case is better to have the bump to 0.7.2 until 0.7.3 is released in the maintainer repo.

Sure, but we can do both, E.G. use 0.7.2 for now but also make 0.7.3 available for the future.

Quoted 6 lines
Quoted 3 lines

It is good that you add yourself to DEVELOPERS, but the click/rich/smmap2 additions belong in a separate commit.

I just wanted to avoid some "noise" caused by separate patch, but yes, you are right this would be the better approach. I will change this in v5.

Great!

Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
(quoted diff) +0 -2
-PYTHON_SNAPPY_VERSION = 0.6.1
-PYTHON_SNAPPY_SITE =

https://files.pythonhosted.org/packages/98/7a/44a24bad98335b2c72e4cadcdecf79f50197d1bab9f22f863a274f104b96

package/python-snappy/python-snappy.mk +3 -0
+PYTHON_SNAPPY_VERSION = 0.7.2
+PYTHON_SNAPPY_SOURCE = python_snappy-$(PYTHON_SNAPPY_VERSION).tar.gz
+PYTHON_SNAPPY_SITE =
Quoted 8 lines

package/python-snappy/python-snappy.mk line 13

Quoted 6 lines

https://files.pythonhosted.org/packages/cb/52/acd87583175fa930e4385f8a6164eb5909acd683c0e62ee01d41de8195a2
PYTHON_SNAPPY_SETUP_TYPE = setuptools
PYTHON_SNAPPY_LICENSE = BSD-3-Clause
PYTHON_SNAPPY_LICENSE_FILES = LICENSE

package/python-snappy/python-snappy.mk +1 -1
-PYTHON_SNAPPY_DEPENDENCIES = snappy
+PYTHON_SNAPPY_DEPENDENCIES = host-python-cramjam python-cramjam

Why do we need host-python-cramjam? Please describe that in the commit message.

Quoted 1 line

This is a setup_requires in the setup.py (cramjam>=2.6.0). There is a build fail without it.

OK, why is this? Is something generated at build time?

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw

Re: [Buildroot] [PATCH v4 RESEND 2/3] package/python-snappy: bump version to 0.7.2

Quoted 6 lines · Peter Korsgaard
Quoted 5 lines · Peter Korsgaard
Quoted 4 lines
Quoted 2 lines

Even if there is a 0.7.3 on Pypi, there is no 0.7.3 release on the project homepage, hence the bump to 0.7.2.

How about contacting the author about the 0.7.3 tag?

Quoted 7 lines
Quoted 4 lines

I will try to contact. In previous situations when I send out a bump it was indicated that I should use a Pypi release only if the tag is released also on the repo. I think also in this case is better to have the bump to 0.7.2 until 0.7.3 is released in the maintainer repo.

Sure, but we can do both, E.G. use 0.7.2 for now but also make 0.7.3 available for the future.

For sure a bump to 0.7.3 will be made once tag available on home page.

Quoted 24 lines
Quoted 6 lines
Quoted 3 lines

It is good that you add yourself to DEVELOPERS, but the click/rich/smmap2 additions belong in a separate commit.

I just wanted to avoid some "noise" caused by separate patch, but yes, you are right this would be the better approach. I will change this in v5.

Great!

Quoted 14 lines
Quoted 14 lines

package/python-snappy/python-snappy.mk line 13

Quoted 12 lines
(quoted diff) +0 -2
-PYTHON_SNAPPY_VERSION = 0.6.1
-PYTHON_SNAPPY_SITE =

https://files.pythonhosted.org/packages/98/7a/44a24bad98335b2c72e4cadcdecf79f50197d1bab9f22f863a274f104b96

package/python-snappy/python-snappy.mk +3 -0
+PYTHON_SNAPPY_VERSION = 0.7.2
+PYTHON_SNAPPY_SOURCE = python_snappy-$(PYTHON_SNAPPY_VERSION).tar.gz
+PYTHON_SNAPPY_SITE =

https://files.pythonhosted.org/packages/cb/52/acd87583175fa930e4385f8a6164eb5909acd683c0e62ee01d41de8195a2
PYTHON_SNAPPY_SETUP_TYPE = setuptools
PYTHON_SNAPPY_LICENSE = BSD-3-Clause
PYTHON_SNAPPY_LICENSE_FILES = LICENSE

package/python-snappy/python-snappy.mk +1 -1
-PYTHON_SNAPPY_DEPENDENCIES = snappy
+PYTHON_SNAPPY_DEPENDENCIES = host-python-cramjam python-cramjam

Why do we need host-python-cramjam? Please describe that in the commit message.

Quoted 3 lines
Quoted 1 line

This is a setup_requires in the setup.py (cramjam>=2.6.0). There is a build fail without it.

OK, why is this? Is something generated at build time?

There is a setup_requires dependency on cramjam>=2.6.0 (file setup.py: setup_requires = ['cramjam>=2.6.0']), which is checked in the host Python environment when building the wheel. Without the host dependencie the build does fail. I have added the explanation why host-python-cramjam is added in the v5 commit message.

Quoted 2 lines
Signature · 1 line
Bye, Peter Korsgaard

Thanks,
Flaviu Nistor
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw

PATCH RESEND v4 3/3 support/testing: add snappy test

In reply to Flaviu Nistor

Add a simple test case that imports the module and does a simple compress decompress routine.

---
 DEVELOPERS                                    |  2 ++
 .../tests/package/sample_python_snappy.py     |  7 ++++
 .../tests/package/test_python_snappy.py       | 34 +++++++++++++++++++
 3 files changed, 43 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_snappy.py
 create mode 100644 support/testing/tests/package/test_python_snappy.py
DEVELOPERS +2 -0
index dbe05b7806..153b2f4af5 100644
@@ -1140,6 +1140,8 @@ F:	package/python-cramjam/
 F:	package/python-rich/
 F:	package/python-smmap2/
 F:	package/python-snappy/
+F:	support/testing/tests/package/sample_python_snappy.py
+F:	support/testing/tests/package/test_python_snappy.py
 
 N:	Flávio Tapajós <[email protected]>
 F:	configs/asus_tinker-s_rk3288_defconfig
support/testing/tests/package/sample_python_snappy.py new file +7 -0
new file mode 100644
index 0000000000..ff2c07c05a
@@ -0,0 +1,7 @@
+import snappy
+
+payload = b"Buildroot python-snappy runtime test\n"
+compressed = snappy.compress(payload)
+decompressed = snappy.uncompress(compressed)
+
+assert decompressed == payload
support/testing/tests/package/test_python_snappy.py new file +34 -0
new file mode 100644
index 0000000000..8c0092bd23
@@ -0,0 +1,34 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Snappy(TestPythonPackageBase):
+    __test__ = True
+    config = """
+        BR2_aarch64=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
+        BR2_LINUX_KERNEL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.135"
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_SNAPPY=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
+    interpreter = "python3"
+    sample_scripts = ["tests/package/sample_python_snappy.py"]
+    timeout = 20
+
+    def login(self):
+        cpio_file = os.path.join(self.builddir, "images", "rootfs.cpio")
+        kern = os.path.join(self.builddir, "images", "Image")
+        self.emulator.boot(arch="aarch64",
+                           kernel=kern,
+                           kernel_cmdline=["console=ttyAMA0"],
+                           options=["-M", "virt", "-cpu", "cortex-a57", "-m", "256M",
+                                    "-initrd", cpio_file])
+        self.emulator.login()
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#7 lore raw

Re: [Buildroot] [PATCH v4 RESEND 3/3] support/testing: add snappy test

Quoted 57 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Flaviu" == Flaviu Nistor <[email protected]> writes:

Add a simple test case that imports the module and does a simple compress decompress routine.

---
 DEVELOPERS                                    |  2 ++
 .../tests/package/sample_python_snappy.py     |  7 ++++
 .../tests/package/test_python_snappy.py       | 34 +++++++++++++++++++
 3 files changed, 43 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_snappy.py
 create mode 100644 support/testing/tests/package/test_python_snappy.py
DEVELOPERS +2 -0
index dbe05b7806..153b2f4af5 100644
@@ -1140,6 +1140,8 @@ F:	package/python-cramjam/
 F:	package/python-rich/
 F:	package/python-smmap2/
 F:	package/python-snappy/
+F:	support/testing/tests/package/sample_python_snappy.py
+F:	support/testing/tests/package/test_python_snappy.py
 
 N:	Flávio Tapajós <[email protected]>
 F:	configs/asus_tinker-s_rk3288_defconfig
support/testing/tests/package/sample_python_snappy.py new file +7 -0
new file mode 100644
index 0000000000..ff2c07c05a
@@ -0,0 +1,7 @@
+import snappy
+
+payload = b"Buildroot python-snappy runtime test\n"
+compressed = snappy.compress(payload)
+decompressed = snappy.uncompress(compressed)
+
+assert decompressed == payload
support/testing/tests/package/test_python_snappy.py new file +11 -0
new file mode 100644
index 0000000000..8c0092bd23
@@ -0,0 +1,34 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Snappy(TestPythonPackageBase):
+    __test__ = True
+    config = """
+        BR2_aarch64=y
+        BR2_TOOLCHAIN_EXTERNAL=y
+        BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"

support/testing/tests/package/test_python_snappy.py line 21

Quoted 10 lines
support/testing/tests/package/test_python_snappy.py new file +10 -0
+        BR2_LINUX_KERNEL=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.135"
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/aarch64-virt/linux.config"
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_SNAPPY=y
+        BR2_TARGET_ROOTFS_CPIO=y
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """

Ideally we should fix the issue that you run into with our default armv5 kernel or at least document why we need this. As an alternative the standard armv7 kernel could also be used, similar to E.G. test_bat.py

support/testing/tests/package/test_python_snappy.py line 22

Quoted 1 line
support/testing/tests/package/test_python_snappy.py new file +1 -0
+    interpreter = "python3"

The default is fine here, so no need to override.

support/testing/tests/package/test_python_snappy.py line 24

Quoted 2 lines
support/testing/tests/package/test_python_snappy.py new file +2 -0
+    sample_scripts = ["tests/package/sample_python_snappy.py"]
+    timeout = 20

Why?

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw

Re: [Buildroot] [PATCH v4 RESEND 3/3] support/testing: add snappy test

Quoted 69 lines · Peter Korsgaard
Quoted 17 lines

Add a simple test case that imports the module and does a simple compress decompress routine.

---
 DEVELOPERS                                    |  2 ++
 .../tests/package/sample_python_snappy.py     |  7 ++++
 .../tests/package/test_python_snappy.py       | 34 +++++++++++++++++++
 3 files changed, 43 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_snappy.py
 create mode 100644 support/testing/tests/package/test_python_snappy.py
DEVELOPERS +0 -0
index dbe05b7806..153b2f4af5 100644

DEVELOPERS F:=09package/python-cramjam/ · line 1144

Quoted 5 lines
DEVELOPERS +2 -0
@@ -1140,6 +1140,8 @@ F:=09package/python-cramjam/
 F:=09package/python-rich/
 F:=09package/python-smmap2/
 F:=09package/python-snappy/
+F:=09support/testing/tests/package/sample_python_snappy.py
+F:=09support/testing/tests/package/test_python_snappy.py

=20

sup=

Quoted 3 lines
DEVELOPERS +0 -0
 N:=09Fl=C3=A1vio Tapaj=C3=B3s <[email protected]>
 F:=09configs/asus_tinker-s_rk3288_defconfig
sup= renamed from support/testing/tests/package/sample_python_snappy.py +0 -0

port/testing/tests/package/sample_python_snappy.py

suppo=

Quoted 13 lines

new file mode 100644
index 0000000000..ff2c07c05a

support/testing/tests/package/sample_python_snappy.py new file +7 -0
@@ -0,0 +1,7 @@
+import snappy
+
+payload =3D b"Buildroot python-snappy runtime test\n"
+compressed =3D snappy.compress(payload)
+decompressed =3D snappy.uncompress(compressed)
+
+assert decompressed =3D=3D payload
suppo= renamed from support/testing/tests/package/test_python_snappy.py +0 -0

rt/testing/tests/package/test_python_snappy.py

Quoted 11 lines

new file mode 100644
index 0000000000..8c0092bd23

support/testing/tests/package/test_python_snappy.py new file +6 -0
@@ -0,0 +1,34 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Snappy(TestPythonPackageBase):

support/testing/tests/package/test_python_snappy.py line 16

Quoted 10 lines
support/testing/tests/package/test_python_snappy.py new file +10 -0
+    __test__ =3D True
+    config =3D """
+        BR2_aarch64=3Dy
+        BR2_TOOLCHAIN_EXTERNAL=3Dy
+        BR2_TARGET_GENERIC_GETTY_PORT=3D"ttyAMA0"
+        BR2_LINUX_KERNEL=3Dy
+        BR2_LINUX_KERNEL_CUSTOM_VERSION=3Dy
+        BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE=3D"6.6.135"
+        BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=3Dy
+        BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE=3D"board/qemu/aarch64-virt/=

linux.config"

support/testing/tests/package/test_python_snappy.py line 21

Quoted 5 lines
support/testing/tests/package/test_python_snappy.py new file +5 -0
+        BR2_PACKAGE_PYTHON3=3Dy
+        BR2_PACKAGE_PYTHON_SNAPPY=3Dy
+        BR2_TARGET_ROOTFS_CPIO=3Dy
+        # BR2_TARGET_ROOTFS_TAR is not set
+        """
Quoted 4 lines

Ideally we should fix the issue that you run into with our default armv5 kernel or at least document why we need this. As an alternative the standard armv7 kernel could also be used, similar to E.G. test_bat.py

Bump to 2.14.0 solved the issue, so the test runs OK also on default armv5 now.

Quoted 3 lines

support/testing/tests/package/test_python_snappy.py line 22

Quoted 2 lines
support/testing/tests/package/test_python_snappy.py new file +1 -0
+    interpreter =3D "python3"

It will be removed in v5.

Quoted 6 lines

The default is fine here, so no need to override.

support/testing/tests/package/test_python_snappy.py line 24

Quoted 2 lines
support/testing/tests/package/test_python_snappy.py new file +2 -0
+    sample_scripts =3D ["tests/package/sample_python_snappy.py"]
+    timeout =3D 20

Why?

It will be removed in v5.

Thanks a lot,
Flaviu.

Quoted 2 lines

--=20
Bye, Peter Korsgaard

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#9 lore raw
In reply to Flaviu Nistor
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Flaviu" == Flaviu Nistor <[email protected]> writes:

Hi,

Quoted 51 lines

Add cramjam, a python bindings to de/compression algorithms. It is needed by python-snappy package in order to bump the version.

---
Changes in v4:
- Update also DEVELOPERS file as suggested by Fiona Klute.
- Link to v3: https://lore.kernel.org/all/[email protected]/

 DEVELOPERS                                 |  3 +++
 package/Config.in                          |  1 +
 package/python-cramjam/Config.in           |  9 +++++++++
 package/python-cramjam/python-cramjam.hash |  4 ++++
 package/python-cramjam/python-cramjam.mk   | 14 ++++++++++++++
 5 files changed, 31 insertions(+)
 create mode 100644 package/python-cramjam/Config.in
 create mode 100644 package/python-cramjam/python-cramjam.hash
 create mode 100644 package/python-cramjam/python-cramjam.mk
DEVELOPERS +3 -0
index f2713c7239..93519574c9 100644
@@ -1134,6 +1134,9 @@ F:	support/testing/tests/package/test_nftables.py
 F:	support/testing/tests/package/test_python_networkmanager_goi.py
 F:	support/testing/tests/package/test_python_pyroute2.py
 
+N:	Flaviu Nistor <[email protected]>
+F:	package/python-cramjam/
+
 N:	Flávio Tapajós <[email protected]>
 F:	configs/asus_tinker-s_rk3288_defconfig
 F:	board/asus/tinker-s/
package/Config.in +1 -0
index fc1e57d30d..d4e3c2fe58 100644
@@ -1061,6 +1061,7 @@ menu "External python modules"
 	source "package/python-construct/Config.in"
 	source "package/python-contourpy/Config.in"
 	source "package/python-couchdb/Config.in"
+	source "package/python-cramjam/Config.in"
 	source "package/python-crayons/Config.in"
 	source "package/python-crc/Config.in"
 	source "package/python-crc16/Config.in"
package/python-cramjam/Config.in new file +0 -0
new file mode 100644
index 0000000000..84119ca968

package/python-cramjam/Config.in line 3

Quoted 3 lines
package/python-cramjam/Config.in new file +3 -0
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_CRAMJAM
+	bool "python-cramjam"
+	depends on !BR2_ARM_CPU_ARMV5

Why? Perhaps you mean BR2_PACKAGE_HOST_RUSTC_TARGET_ARCH_SUPPORTS?

Quoted 12 lines
package/python-cramjam/Config.in new file +6 -0
+	help
+	  Python bindings to de/compression algorithms in Rust.
+	  Allows for using algorithms such as Snappy, without any
+	  system or other python dependencies.
+
+	  https://pypi.org/project/cramjam
package/python-cramjam/python-cramjam.hash new file +0 -0
new file mode 100644
index 0000000000..2042bb6281

package/python-cramjam/python-cramjam.hash line 2

Quoted 2 lines
package/python-cramjam/python-cramjam.hash new file +2 -0
@@ -0,0 +1,4 @@
+# Locally computed sha256 checksums
+sha256  542ea349a7528d88935856d3eb562cd17bff713d7a41eab8d6812d78a3cb00ba  cramjam-2.11.0.tar.gz

You only need the vendored tarball here, E.G. see python-cryptography.

Committed with those changes, thanks.

Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot