Skip to contentSkip to conversation

package/python-gobject: depend on python2

PATCH New aduskett at gmail.com 3 participants 4 messages Dec 1, 2019 – Dec 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 package/python-gobject: depend on python2

From: Adam Duskett <[email protected]>

Version 2.86.6 of python-gobject is quite old and no longer works with Python versions > 3.7. When importing a user will recieve the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/gobject/__init__.py", line 26, in <module>
File "/usr/lib/python3.8/site-packages/glib/__init__.py", line 22, in <module>
SystemError: initialization of _glib raised unreported exception

Because new versions of python-gobject require gobject-introspection, which is not currently available in Buildroot, add a dependency on python2 to prevent users from receiving the above error.

---
Changes v1 -> v2:
- Add missing depends on in the comment section of python-gobject/Config.in (Thomas)

 package/python-gobject/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/python-gobject/Config.in +2 -0
index 475ff25185..36ddffebb0 100644
@@ -3,6 +3,7 @@ config BR2_PACKAGE_PYTHON_GOBJECT
 	depends on BR2_USE_WCHAR # libglib2
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
 	depends on BR2_USE_MMU # libglib2
+	depends on BR2_PACKAGE_PYTHON # Broken with python 3.8
 	select BR2_PACKAGE_LIBGLIB2
 	help
 	  Python bindings for the GLib/GObject library
@@ -10,5 +11,6 @@ config BR2_PACKAGE_PYTHON_GOBJECT
 	  https://wiki.gnome.org/action/show/Projects/PyGObject
 
 comment "python-gobject needs a toolchain w/ wchar, threads"
+	depends on BR2_PACKAGE_PYTHON
 	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS
Signature · 1 line
2.23.0
#1 lore raw

PATCH v2 2/2 support/testing: add python-gobject test

From: Adam Duskett <[email protected]>

Add a simple test case that imports the module.

---
 DEVELOPERS                                            |  1 +
 .../testing/tests/package/sample_python_gobject.py    |  1 +
 support/testing/tests/package/test_python_gobject.py  | 11 +++++++++++
 3 files changed, 13 insertions(+)
 create mode 100644 support/testing/tests/package/sample_python_gobject.py
 create mode 100644 support/testing/tests/package/test_python_gobject.py
DEVELOPERS +1 -0
index 4adaac0c3d..c9fd98636e 100644
@@ -74,6 +74,7 @@ F:	package/semodule-utils/
 F:	package/setools/
 F:	package/sngrep/
 F:	package/systemd/
+F:	support/testing/tests/package/test_python_gobject.py
 
 N:	Adam Heinrich <[email protected]>
 F:	package/jack1/
support/testing/tests/package/sample_python_gobject.py new file +1 -0
new file mode 100644
index 0000000000..84ebee7362
@@ -0,0 +1 @@
+import gobject  # noqa
support/testing/tests/package/test_python_gobject.py new file +11 -0
new file mode 100644
index 0000000000..0a59447adb
@@ -0,0 +1,11 @@
+from tests.package.test_python import TestPythonPackageBase
+
+
+class TestPythonPy2Gobject(TestPythonPackageBase):
+    __test__ = True
+    config = TestPythonPackageBase.config + \
+        """
+        BR2_PACKAGE_PYTHON=y
+        BR2_PACKAGE_PYTHON_GOBJECT=y
+        """
+    sample_scripts = ["tests/package/sample_python_gobject.py"]
Signature · 1 line
2.23.0
#2 lore raw

PATCH v2 1/2 package/python-gobject: depend on python2

In reply to aduskett at gmail.com
Quoted 12 lines · On Sun, 1 Dec 2019 10:39:08 -0800 aduskett at gmail.com wrote:

From: Adam Duskett <[email protected]>

Version 2.86.6 of python-gobject is quite old and no longer works with Python versions > 3.7. When importing a user will recieve the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/gobject/__init__.py", line 26, in <module>
File "/usr/lib/python3.8/site-packages/glib/__init__.py", line 22, in <module>
SystemError: initialization of _glib raised unreported exception

Quoted 3 lines

Because new versions of python-gobject require gobject-introspection, which is not currently available in Buildroot, add a dependency on python2 to prevent users from receiving the above error.

You forgot to add the reference to the bug being fixed, despite this being noted in my review of v1. No need to resend just for that though.

Fixes:

https://bugs.busybox.net/show_bug.cgi?id=12286

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw

PATCH v2 1/2 package/python-gobject: depend on python2

In reply to aduskett at gmail.com
Quoted 12 lines · aduskett at gmail.com

From: Adam Duskett <[email protected]>

Version 2.86.6 of python-gobject is quite old and no longer works with Python versions > 3.7. When importing a user will recieve the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3.8/site-packages/gobject/__init__.py", line 26, in <module>
File "/usr/lib/python3.8/site-packages/glib/__init__.py", line 22, in <module>
SystemError: initialization of _glib raised unreported exception

Quoted 5 lines

Because new versions of python-gobject require gobject-introspection, which is not currently available in Buildroot, add a dependency on python2 to prevent users from receiving the above error.

Both applied to master, thanks (after adding the Fixes: tag).

Regards,
Arnout

Quoted 28 lines

---
Changes v1 -> v2:
- Add missing depends on in the comment section of python-gobject/Config.in (Thomas)

 package/python-gobject/Config.in | 2 ++
 1 file changed, 2 insertions(+)
package/python-gobject/Config.in +2 -0
index 475ff25185..36ddffebb0 100644
@@ -3,6 +3,7 @@ config BR2_PACKAGE_PYTHON_GOBJECT
 	depends on BR2_USE_WCHAR # libglib2
 	depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
 	depends on BR2_USE_MMU # libglib2
+	depends on BR2_PACKAGE_PYTHON # Broken with python 3.8
 	select BR2_PACKAGE_LIBGLIB2
 	help
 	  Python bindings for the GLib/GObject library
@@ -10,5 +11,6 @@ config BR2_PACKAGE_PYTHON_GOBJECT
 	  https://wiki.gnome.org/action/show/Projects/PyGObject
 
 comment "python-gobject needs a toolchain w/ wchar, threads"
+	depends on BR2_PACKAGE_PYTHON
 	depends on BR2_USE_MMU
 	depends on !BR2_USE_WCHAR || !BR2_TOOLCHAIN_HAS_THREADS