Skip to contentSkip to conversation

package/python-snappy: bump version to 0.7.2

PATCH Applied Flaviu Nistor 2 participants 6 messages Oct 16 – Oct 30

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/2 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 starting 0.7.0 bibrary is switched from snappy to cramjam, update the PYTHON_SNAPPY_DEPENDENCIES.
Add also PYTHON_SNAPPY_SOURCE for correct package on Pypi.
Add host-python-cramjam to satisfy python-snappy's setup_requires dependency on cramjam>=2.6.0, which is checked in the host Python environment when building the wheel. Without the host dependencie the build will fail.

---
Changes in v5:
- Remove depends on !BR2_ARM_CPU_ARMV5 since it is not needed
- Link to v4: https://lore.kernel.org/all/[email protected]/
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                               | 1 +
 package/python-snappy/Config.in          | 6 +-----
 package/python-snappy/python-snappy.hash | 4 ++--
 package/python-snappy/python-snappy.mk   | 7 ++++---
 4 files changed, 8 insertions(+), 10 deletions(-)
DEVELOPERS +1 -0
index 349fb1d26a..2773f0776a 100644
@@ -1146,6 +1146,7 @@ F:	support/testing/tests/package/test_python_pyroute2.py
 
 N:	Flaviu Nistor <[email protected]>
 F:	package/python-cramjam/
+F:	package/python-snappy/
 
 N:	Flávio Tapajós <[email protected]>
 F:	configs/asus_tinker-s_rk3288_defconfig
package/python-snappy/Config.in +1 -5
index fd7f84050f..3add15a3f9 100644
@@ -1,12 +1,8 @@
 config BR2_PACKAGE_PYTHON_SNAPPY
 	bool "python-snappy"
-	depends on BR2_INSTALL_LIBSTDCPP # snappy
-	select BR2_PACKAGE_SNAPPY
+	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
#1 lore raw

PATCH v5 2/2 support/testing: add snappy test

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

---
Changes in v5:
- Use default armv5 for the test since cramjam does not fail to run on 32-bit architectures on version 2.14.0 on which python-snappy depends on.
- Link to v4: https://lore.kernel.org/all/[email protected]/

 DEVELOPERS                                          |  2 ++
 .../testing/tests/package/sample_python_snappy.py   |  5 +++++
 support/testing/tests/package/test_python_snappy.py | 13 +++++++++++++
 3 files changed, 20 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 2773f0776a..9994630c6f 100644
@@ -1147,6 +1147,8 @@ F:	support/testing/tests/package/test_python_pyroute2.py
 N:	Flaviu Nistor <[email protected]>
 F:	package/python-cramjam/
 F:	package/python-snappy/
+F:	support/testing/tests/package/test_python_snappy.py
+F:	support/testing/tests/package/sample_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 +5 -0
new file mode 100644
index 0000000000..842a4e98e5
@@ -0,0 +1,5 @@
+import snappy
+
+payload = b"Buildroot python-snappy runtime test\n"
+compressed = snappy.compress(payload)
+decompressed = snappy.uncompress(compressed)
support/testing/tests/package/test_python_snappy.py new file +13 -0
new file mode 100644
index 0000000000..1c07ddc1e8
@@ -0,0 +1,13 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3Snappy(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_SNAPPY=y
+        """
+    sample_scripts = ["tests/package/sample_python_snappy.py"]
Signature · 6 lines
2.34.1

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

Re: [Buildroot] [PATCH v5 2/2] support/testing: add snappy test

Quoted 4 lines · Flaviu Nistor

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

Applied to master, thanks!

Best regards,

Thomas Petazzoni

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Re: [Buildroot] [PATCH v5 2/2] support/testing: add snappy test

In reply to Flaviu Nistor

In reply of:

Quoted 4 lines

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

Applied to 2025.02.x, 2026.08.x. Thanks

Quoted 46 lines

---
Changes in v5:
- Use default armv5 for the test since cramjam does not fail to run on 32-bit architectures on version 2.14.0 on which python-snappy depends on.
- Link to v4: https://lore.kernel.org/all/[email protected]/

 DEVELOPERS                                          |  2 ++
 .../testing/tests/package/sample_python_snappy.py   |  5 +++++
 support/testing/tests/package/test_python_snappy.py | 13 +++++++++++++
 3 files changed, 20 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 2773f0776a..9994630c6f 100644
@@ -1147,6 +1147,8 @@ F:	support/testing/tests/package/test_python_pyroute2.py
 N:	Flaviu Nistor <[email protected]>
 F:	package/python-cramjam/
 F:	package/python-snappy/
+F:	support/testing/tests/package/test_python_snappy.py
+F:	support/testing/tests/package/sample_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 +5 -0
new file mode 100644
index 0000000000..842a4e98e5
@@ -0,0 +1,5 @@
+import snappy
+
+payload = b"Buildroot python-snappy runtime test\n"
+compressed = snappy.compress(payload)
+decompressed = snappy.uncompress(compressed)
support/testing/tests/package/test_python_snappy.py new file +3 -0
new file mode 100644
index 0000000000..1c07ddc1e8
@@ -0,0 +1,13 @@
+import os
+
+from tests.package.test_python import TestPythonPackageBase

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

Quoted 10 lines
support/testing/tests/package/test_python_snappy.py new file +10 -0
+
+
+class TestPythonPy3Snappy(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_SNAPPY=y
+        """
+    sample_scripts = ["tests/package/sample_python_snappy.py"]

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

#4 lore raw
In reply to Flaviu Nistor

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

Quoted 10 lines · Flaviu Nistor
package/python-snappy/python-snappy.mk +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

It's a bit annoying to pull in host-python-cramjam for no other reason than making the dependency check happy. So instead I've changed to use:

PYTHON_SNAPPY_BUILD_OPTS = --skip-dependency-check

and drop the two dependencies. python-cramjam becomes a pure runtime dependency. Verified by running your test in PATCH 2/2.

Applied with this change (and a reworded commit log), thanks!

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#5 lore raw
Quoted 15 lines · Thomas Petazzoni

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

Quoted 10 lines · Flaviu Nistor
package/python-snappy/python-snappy.mk +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

It's a bit annoying to pull in host-python-cramjam for no other reason than making the dependency check happy. So instead I've changed to use:

Indeed it is annoying and does not make a lot of sense. I could not find a workaround for the build error, so thank you for your solution. I did not think of it, but it is nice to learn something now.

Best regards,
Flaviu Nistor

Quoted 13 lines

PYTHON_SNAPPY_BUILD_OPTS = --skip-dependency-check

and drop the two dependencies. python-cramjam becomes a pure runtime dependency. Verified by running your test in PATCH 2/2.

Applied with this change (and a reworded commit log), thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com

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