Skip to contentSkip to conversation

package/python-ruamel-yaml: fix comment in hash file

PATCH Applied Marcus Hoffmann via buildroot 2 participants 10 messages Feb 7, 2024 – Jul 31, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 package/python-ruamel-yaml: fix comment in hash file

---
 package/python-ruamel-yaml/python-ruamel-yaml.hash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-ruamel-yaml/python-ruamel-yaml.hash +1 -1
index 29852a51ed..ee5016835b 100644
@@ -1,4 +1,4 @@
-# md5, sha256 from https://pypi.org/pypi/rfc3987/json
+# md5, sha256 from https://pypi.org/pypi/ruamel.yaml/json
 md5  206bda0f33ab2c2f63777636200748b7  ruamel.yaml-0.17.21.tar.gz
 sha256  8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af  ruamel.yaml-0.17.21.tar.gz
 # Locally computed sha256 checksums
Signature · 6 lines
2.43.0

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

PATCH 2/4 support/testing: add new python-ruamel-yaml runtime test

---
 .../package/sample_python_ruamel_yaml.py      | 27 +++++++++++++++++++
 .../tests/package/test_python_ruamel_yaml.py  | 12 +++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_ruamel_yaml.py
 create mode 100644 support/testing/tests/package/test_python_ruamel_yaml.py
support/testing/tests/package/sample_python_ruamel_yaml.py new file +27 -0
new file mode 100644
index 0000000000..5b3a079471
@@ -0,0 +1,27 @@
+from ruamel.yaml import YAML
+
+yaml_text = """
+Rootkey:
+  - ListEntry
+AnotherRootKey: some-string
+
+ListRoot:
+  - float-value: '1.0'
+    int-value: 10234
+    NestedList:
+      - 1
+      - 2
+
+  - another-float: '1.1'
+    another-int: 1111
+
+OneMoreRootKey: 9.99
+"""
+
+# Tests the pure python based implementation
+yaml = YAML(typ='safe', pure=True)
+
+parsed = yaml.load(yaml_text)
+
+assert parsed['OneMoreRootKey'] == 9.99
+assert parsed['ListRoot'][1]['another-int'] == 1111
support/testing/tests/package/test_python_ruamel_yaml.py new file +12 -0
new file mode 100644
index 0000000000..15062b4455
@@ -0,0 +1,12 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy3RuamelYaml(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON3=y
+        BR2_PACKAGE_PYTHON_RUAMEL_YAML=y
+        """
+    sample_scripts = ["tests/package/sample_python_ruamel_yaml.py"]
+    timeout = 40
Signature · 6 lines
2.43.0

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

Re: [Buildroot] [PATCH 2/4] support/testing: add new python-ruamel-yaml runtime test

Quoted 7 lines · On Wed, 7 Feb 2024 18:09:54 +0100 Marcus Hoffmann via buildroot…
---
 .../package/sample_python_ruamel_yaml.py      | 27 +++++++++++++++++++
 .../tests/package/test_python_ruamel_yaml.py  | 12 +++++++++
 2 files changed, 39 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_ruamel_yaml.py
 create mode 100644 support/testing/tests/package/test_python_ruamel_yaml.py

You had forgotten to add an entry in the DEVELOPERS file for those two new files, so I did that and applied. Thanks a lot!

Thomas

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

Re: [Buildroot] [PATCH 2/4] support/testing: add new python-ruamel-yaml runtime test

In reply to Marcus Hoffmann via buildroot
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Marcus" == Marcus Hoffmann via buildroot <[email protected]> writes:

Committed to 2024.02.x and 2024.05.x, thanks.

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

PATCH 3/4 package/python-ruamel-yaml-clib: new package

In reply to Marcus Hoffmann via buildroot

Add optional c extension for python-ruamel-yaml which can speed up yaml loading/parsing.

Extend the ruamel-yaml runtime test to check if the c extension works correctly.

---
 package/Config.in                                |  1 +
 package/python-ruamel-yaml-clib/Config.in        |  9 +++++++++
 .../python-ruamel-yaml-clib.hash                 |  5 +++++
 .../python-ruamel-yaml-clib.mk                   | 16 ++++++++++++++++
 .../tests/package/sample_python_ruamel_yaml.py   | 12 ++++++++++++
 .../tests/package/test_python_ruamel_yaml.py     |  1 +
 6 files changed, 44 insertions(+)
 create mode 100644 package/python-ruamel-yaml-clib/Config.in
 create mode 100644 package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.hash
 create mode 100644 package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk
package/Config.in +1 -0
index bf8c325e99..e256202276 100644
@@ -1320,6 +1320,7 @@ menu "External python modules"
 	source "package/python-rtoml/Config.in"
 	source "package/python-rtslib-fb/Config.in"
 	source "package/python-ruamel-yaml/Config.in"
+	source "package/python-ruamel-yaml-clib/Config.in"
 	source "package/python-s3transfer/Config.in"
 	source "package/python-scandir/Config.in"
 	source "package/python-scapy/Config.in"
package/python-ruamel-yaml-clib/Config.in new file +9 -0
new file mode 100644
index 0000000000..a06080873f
@@ -0,0 +1,9 @@
+if BR2_PACKAGE_PYTHON_RUAMEL_YAML
+config BR2_PACKAGE_PYTHON_RUAMEL_YAML_CLIB
+	bool "python-ruamel-yaml-clib"
+	help
+	  C version of reader, parser and emitter for ruamel.yaml
+	  derived from libyaml
+
+	  https://sourceforge.net/projects/ruamel-yaml/
+endif
package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.hash new file +5 -0
new file mode 100644
index 0000000000..937afc3df1
@@ -0,0 +1,5 @@
+# md5, sha256 from https://pypi.org/pypi/ruamel.yaml.clib/json
+md5  b72e549363fa1b9c4f9123e98f2b46cc  ruamel.yaml.clib-0.2.8.tar.gz
+sha256  beb2e0404003de9a4cab9753a8805a8fe9320ee6673136ed7f04255fe60bb512  ruamel.yaml.clib-0.2.8.tar.gz
+# Locally computed sha256 checksums
+sha256  5458f90e82366f660f956b3c929ba5f7a0efdb99a99a847e2f51f2020ffbe887  LICENSE
package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk new file +16 -0
new file mode 100644
index 0000000000..3e5434fa9a
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python-ruamel-yaml
+#
+################################################################################
+
+PYTHON_RUAMEL_YAML_CLIB_VERSION = 0.2.8
+PYTHON_RUAMEL_YAML_CLIB_SOURCE = ruamel.yaml.clib-$(PYTHON_RUAMEL_YAML_CLIB_VERSION).tar.gz
+PYTHON_RUAMEL_YAML_CLIB_SITE = https://files.pythonhosted.org/packages/46/ab/bab9eb1566cd16f060b54055dd39cf6a34bfa0240c53a7218c43e974295b
+PYTHON_RUAMEL_YAML_CLIB_SETUP_TYPE = setuptools
+PYTHON_RUAMEL_YAML_CLIB_LICENSE = MIT
+PYTHON_RUAMEL_YAML_CLIB_LICENSE_FILES = LICENSE
+PYTHON_RUAMEL_YAML_CLIB_CPE_ID_VENDOR = ruamel.yaml_project
+PYTHON_RUAMEL_YAML_CLIB_CPE_ID_PRODUCT = ruamel.yaml
+
+$(eval $(python-package))
support/testing/tests/package/sample_python_ruamel_yaml.py +12 -0
index 5b3a079471..55cd696278 100644
@@ -25,3 +25,15 @@ parsed = yaml.load(yaml_text)
 
 assert parsed['OneMoreRootKey'] == 9.99
 assert parsed['ListRoot'][1]['another-int'] == 1111
+
+# Tests the C extension based loader
+# ruamel.yaml automatically falls back to the pure python version, so we need
+# to explicitly check if importing the CLoader works here.
+# Import this here, so it's clearer what part of the test is failing.
+from ruamel.yaml import CLoader  # noqa: E402
+assert CLoader is not None
+yaml = YAML(typ='safe')
+parsed_from_c = yaml.load(yaml_text)
+
+assert parsed_from_c['OneMoreRootKey'] == 9.99
+assert parsed_from_c['ListRoot'][1]['another-int'] == 1111
support/testing/tests/package/test_python_ruamel_yaml.py +1 -0
index 15062b4455..b145da4b24 100644
@@ -7,6 +7,7 @@ class TestPythonPy3RuamelYaml(TestPythonPackageBase):
         """
         BR2_PACKAGE_PYTHON3=y
         BR2_PACKAGE_PYTHON_RUAMEL_YAML=y
+        BR2_PACKAGE_PYTHON_RUAMEL_YAML_CLIB=y
         """
     sample_scripts = ["tests/package/sample_python_ruamel_yaml.py"]
     timeout = 40
Signature · 6 lines
2.43.0

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

Re: [Buildroot] [PATCH 3/4] package/python-ruamel-yaml-clib: new package

Hello Marcus,

package/python-ruamel-yaml-clib/Config.in line 3

Quoted 9 lines · On Wed, 7 Feb 2024 18:09:55 +0100 Marcus Hoffmann via buildroot…
package/python-ruamel-yaml-clib/Config.in new file +3 -0
new file mode 100644
index 0000000000..a06080873f
@@ -0,0 +1,9 @@
+if BR2_PACKAGE_PYTHON_RUAMEL_YAML
+config BR2_PACKAGE_PYTHON_RUAMEL_YAML_CLIB
+	bool "python-ruamel-yaml-clib"

Changed the if BR2_PACKAGE_PYTHON_RUAMEL_YAML to a depends on BR2_PACKAGE_PYTHON_RUAMEL_YAML, which is more common for this type of situation IMO.

package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk line 3

Quoted 9 lines
package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk new file +3 -0
new file mode 100644
index 0000000000..3e5434fa9a
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python-ruamel-yaml

Bad copy/paste, should have been python-ruamel-yaml-clib.

package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk line 14

Quoted 11 lines
package/python-ruamel-yaml-clib/python-ruamel-yaml-clib.mk new file +11 -0
+#
+################################################################################
+
+PYTHON_RUAMEL_YAML_CLIB_VERSION = 0.2.8
+PYTHON_RUAMEL_YAML_CLIB_SOURCE = ruamel.yaml.clib-$(PYTHON_RUAMEL_YAML_CLIB_VERSION).tar.gz
+PYTHON_RUAMEL_YAML_CLIB_SITE = https://files.pythonhosted.org/packages/46/ab/bab9eb1566cd16f060b54055dd39cf6a34bfa0240c53a7218c43e974295b
+PYTHON_RUAMEL_YAML_CLIB_SETUP_TYPE = setuptools
+PYTHON_RUAMEL_YAML_CLIB_LICENSE = MIT
+PYTHON_RUAMEL_YAML_CLIB_LICENSE_FILES = LICENSE
+PYTHON_RUAMEL_YAML_CLIB_CPE_ID_VENDOR = ruamel.yaml_project
+PYTHON_RUAMEL_YAML_CLIB_CPE_ID_PRODUCT = ruamel.yaml

I dropped those two lines. Indeed, the CPE vendor/product (at least product) cannot be the same as for python-ruamel-yaml, as they have different versioning.

Also, the entry in the DEVELOPERS file was missing, so I added it.

Applied with those fixes. 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
#6 lore raw

PATCH 4/4 package/python-ruamel-yaml: bump to version 0.18.5

In reply to Marcus Hoffmann via buildroot

From: James Hilliard <[email protected]>

License hash changed due to year update:
https://sourceforge.net/p/ruamel-yaml/code/ci/56b3e2666fb275deab3eec99193c103e4edf93bb/

---
 package/python-ruamel-yaml/python-ruamel-yaml.hash | 6 +++---
 package/python-ruamel-yaml/python-ruamel-yaml.mk   | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
package/python-ruamel-yaml/python-ruamel-yaml.hash +3 -3
index ee5016835b..02845d112b 100644
@@ -1,5 +1,5 @@
 # md5, sha256 from https://pypi.org/pypi/ruamel.yaml/json
-md5  206bda0f33ab2c2f63777636200748b7  ruamel.yaml-0.17.21.tar.gz
-sha256  8b7ce697a2f212752a35c1ac414471dc16c424c9573be4926b56ff3f5d23b7af  ruamel.yaml-0.17.21.tar.gz
+md5  24fac3544a3c7bd7eeaf6e4f704a056e  ruamel.yaml-0.18.5.tar.gz
+sha256  61917e3a35a569c1133a8f772e1226961bf5a1198bea7e23f06a0841dea1ab0e  ruamel.yaml-0.18.5.tar.gz
 # Locally computed sha256 checksums
-sha256  ab837b032c5aae84503fc0c733a116a26fd272e90dc4402fa68d3c9e51aed3b0  LICENSE
+sha256  ba45629abb7022949148ce65de4a59e7ee164d30c94450389a6afdd3ebe4e9e0  LICENSE
package/python-ruamel-yaml/python-ruamel-yaml.mk +2 -2
index a6fed3bc2c..bbdac591ca 100644
@@ -4,9 +4,9 @@
 #
 ################################################################################
 
-PYTHON_RUAMEL_YAML_VERSION = 0.17.21
+PYTHON_RUAMEL_YAML_VERSION = 0.18.5
 PYTHON_RUAMEL_YAML_SOURCE = ruamel.yaml-$(PYTHON_RUAMEL_YAML_VERSION).tar.gz
-PYTHON_RUAMEL_YAML_SITE = https://files.pythonhosted.org/packages/46/a9/6ed24832095b692a8cecc323230ce2ec3480015fbfa4b79941bd41b23a3c
+PYTHON_RUAMEL_YAML_SITE = https://files.pythonhosted.org/packages/82/43/fa976e03a4a9ae406904489119cd7dd4509752ca692b2e0a19491ca1782c
 PYTHON_RUAMEL_YAML_SETUP_TYPE = setuptools
 PYTHON_RUAMEL_YAML_LICENSE = MIT
 PYTHON_RUAMEL_YAML_LICENSE_FILES = LICENSE
Signature · 6 lines
2.43.0

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

Re: [Buildroot] [PATCH 4/4] package/python-ruamel-yaml: bump to version 0.18.5

Quoted 11 lines · On Wed, 7 Feb 2024 18:09:56 +0100 Marcus Hoffmann via buildroot…

From: James Hilliard <[email protected]>

License hash changed due to year update:
https://sourceforge.net/p/ruamel-yaml/code/ci/56b3e2666fb275deab3eec99193c103e4edf93bb/

---
 package/python-ruamel-yaml/python-ruamel-yaml.hash | 6 +++---
 package/python-ruamel-yaml/python-ruamel-yaml.mk   | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#8 lore raw
In reply to Marcus Hoffmann via buildroot
Quoted 4 lines · On Wed, 7 Feb 2024 18:09:53 +0100 Marcus Hoffmann via buildroot…
---
 package/python-ruamel-yaml/python-ruamel-yaml.hash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#9 lore raw
In reply to Marcus Hoffmann via buildroot
Quoted 3 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Marcus" == Marcus Hoffmann via buildroot <[email protected]> writes:

Committed to 2024.02.x and 2024.05.x, thanks.

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