[gentoo-commits] repo/gentoo:master commit in: dev-python/pygobject/, dev-python/pygobject/files/
commit: 8e0d5facc35dc749b754408f5ec151a2d65be175 Author: Michał Górny gentoo org> AuthorDate: Sun Jun 20 16:15:01 2021 + Commit: Michał Górny gentoo org> CommitDate: Sun Jun 20 16:31:45 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e0d5fac dev-python/pygobject: Fix ImportWarnings with py3.10 Closes: https://bugs.gentoo.org/796929 Signed-off-by: Michał Górny gentoo.org> .../pygobject-3.40.1-dynamicimporter-py310.patch | 63 + dev-python/pygobject/pygobject-3.40.1-r1.ebuild| 78 ++ 2 files changed, 141 insertions(+) diff --git a/dev-python/pygobject/files/pygobject-3.40.1-dynamicimporter-py310.patch b/dev-python/pygobject/files/pygobject-3.40.1-dynamicimporter-py310.patch new file mode 100644 index 000..341a096767b --- /dev/null +++ b/dev-python/pygobject/files/pygobject-3.40.1-dynamicimporter-py310.patch @@ -0,0 +1,63 @@ +From 1ae65be0f7e621002e2e29921e0252c1b57a170c Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 20 Jun 2021 17:54:52 +0200 +Subject: [PATCH] Implement PEP451 semantics for DynamicImporter + +Make DynamicImporter PEP451-compliant in order to silence ImportWarnings +in Python 3.10. This is mostly based on six._SixMetaPathImporter. + +Fixes #476 +--- + gi/importer.py | 18 ++ + 1 file changed, 18 insertions(+) + +diff --git a/gi/importer.py b/gi/importer.py +index 32967974..006cf464 100644 +--- a/gi/importer.py b/gi/importer.py +@@ -24,6 +24,7 @@ + import sys + import warnings + import importlib ++import importlib.util + from contextlib import contextmanager + + import gi +@@ -103,6 +104,7 @@ def get_import_stacklevel(import_hook): + class DynamicImporter(object): + + # Note: see PEP302 for the Importer Protocol implemented below. ++# PEP451 for A ModuleSpec Type for the Import System. + + def __init__(self, path): + self.path = path +@@ -117,6 +119,16 @@ class DynamicImporter(object): + + return self + ++def find_spec(self, fullname, path, target=None): ++if not fullname.startswith(self.path): ++return None ++ ++path, namespace = fullname.rsplit('.', 1) ++if path != self.path: ++return None ++ ++return importlib.util.spec_from_loader(fullname, self) ++ + def load_module(self, fullname): + if fullname in sys.modules: + return sys.modules[fullname] +@@ -149,3 +161,9 @@ class DynamicImporter(object): + sys.modules[fullname] = dynamic_module + + return dynamic_module ++ ++def create_module(self, spec): ++return self.load_module(spec.name) ++ ++def exec_module(self, module): ++pass +-- +2.32.0 + diff --git a/dev-python/pygobject/pygobject-3.40.1-r1.ebuild b/dev-python/pygobject/pygobject-3.40.1-r1.ebuild new file mode 100644 index 000..01f7b7055eb --- /dev/null +++ b/dev-python/pygobject/pygobject-3.40.1-r1.ebuild @@ -0,0 +1,78 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..10} ) + +inherit gnome.org meson python-r1 virtualx xdg + +DESCRIPTION="Python bindings for GObject Introspection" +HOMEPAGE="https://pygobject.readthedocs.io/; + +LICENSE="LGPL-2.1+" +SLOT="3" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris" +IUSE="+cairo examples test" +RESTRICT="!test? ( test )" +REQUIRED_USE="${PYTHON_REQUIRED_USE}" + +RDEPEND="${PYTHON_DEPS} + >=dev-libs/glib-2.56:2 + >=dev-libs/gobject-introspection-1.56:= + dev-libs/libffi:= + cairo? ( + >=dev-python/pycairo-1.16.0[${PYTHON_USEDEP}] + x11-libs/cairo[glib] ) +" +DEPEND="${RDEPEND} + test? ( + dev-libs/atk[introspection] + dev-python/pytest[${PYTHON_USEDEP}] + x11-libs/gdk-pixbuf:2[introspection,jpeg] + x11-libs/gtk+:3[introspection] + x11-libs/pango[introspection] + ) +" +BDEPEND=" + virtual/pkgconfig +" + +PATCHES=( + "${FILESDIR}"/${P}-dynamicimporter-py310.patch +) + +src_configure() { + configuring() { + meson_src_configure \ + $(meson_feature cairo pycairo) \ + $(meson_use test tests) \ + -Dpython="${EPYTHON}" + } + + python_foreach_impl configuring +} + +src_compile() { + python_foreach_impl meson_src_compile +} + +src_test() { + local -x GIO_USE_VFS="local" # prevents odd issues with deleting ${T}/.gvfs + local -x GIO_USE_VOLUME_MONITOR="unix" # prevent udisks-related failures in chroots, bug #449484 + + testing() { + local -x XDG_CACHE_HOME="${T}/${EPYTHON}" + meson_src_test || die "test failed
[gentoo-commits] repo/gentoo:master commit in: dev-python/pygobject/, dev-python/pygobject/files/
commit: a10be9ce04476fe367fefd84265d0a5d44ff2d74 Author: Michał Górny gentoo org> AuthorDate: Sun Sep 20 08:11:59 2020 + Commit: Michał Górny gentoo org> CommitDate: Sun Sep 20 08:16:46 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a10be9ce dev-python/pygobject: Remove old Signed-off-by: Michał Górny gentoo.org> dev-python/pygobject/Manifest | 1 - .../pygobject-2.28.3-fix-codegen-location.patch| 64 - .../files/pygobject-2.28.3-make_check.patch| 76 - ...t-2.28.3-support_multiple_python_versions.patch | 103 --- .../pygobject-2.28.6-disable-failing-tests.patch | 98 --- .../files/pygobject-2.28.6-gio-types-2.32.patch| 50 .../pygobject-2.28.6-glib-2.36-class_init.patch| 315 - .../files/pygobject-2.28.6-set_qdata.patch | 28 -- .../pygobject-2.28.6-tests-no-introspection.patch | 33 --- dev-python/pygobject/pygobject-2.28.6-r55.ebuild | 132 - 10 files changed, 900 deletions(-) diff --git a/dev-python/pygobject/Manifest b/dev-python/pygobject/Manifest index 254a957c983..c36dda5234e 100644 --- a/dev-python/pygobject/Manifest +++ b/dev-python/pygobject/Manifest @@ -1,3 +1,2 @@ -DIST pygobject-2.28.6.tar.xz 747248 BLAKE2B 5f92794034b2d0559a623db4a7d273a7dc3f099cae87ede91b17e81acac085a9298c6b81b45b4b8540b6a75ced97e474a993437dbfcfc2133d3321d6a979b541 SHA512 37544ea2377258758169b25a2969d5ee1c9ffb9b6e63e05bc7a0471a49ac9169c51ec587d4489172c7d256f53df878a81c1992a08059aa7e43dbbb69f799545c DIST pygobject-3.34.0.tar.xz 552268 BLAKE2B a9cbeb644e0aa1b23067b591fe5c6299741395656631d39782a8c183a5d3a8e5e7f1a81acdefee186b7cc2bc34dda9271468b1828d5b9613ddc1256e24f1ecb8 SHA512 782195d22e564b88dea8d43469f0111f398b44b51a63df2fe7d07650af94d5cd037f322a5d7e405338823be3419fcdbf0113fe50b220ab1cfd07d4d01dbc4766 DIST pygobject-3.36.1.tar.xz 556568 BLAKE2B cd38aec8e71ff230926327e77867d07ae0fd5549b71619301bb3be01821ea93e557ecf335ea238292176981a864b269eaa2a86da47e8fb320f187f54caf24dc4 SHA512 5e00dcd03dfe4f92acbf827c13c164b6b9740b2a8cef3b2dce70f96a2156fee2411c84dc669f12b910f4a93daa03ba845282832e2b09d8c887102d43764a345f diff --git a/dev-python/pygobject/files/pygobject-2.28.3-fix-codegen-location.patch b/dev-python/pygobject/files/pygobject-2.28.3-fix-codegen-location.patch deleted file mode 100644 index 0a526b8..000 --- a/dev-python/pygobject/files/pygobject-2.28.3-fix-codegen-location.patch +++ /dev/null @@ -1,64 +0,0 @@ -From b3e852d29bfd1e90f7e0da409fd0ae36cc01675a Mon Sep 17 00:00:00 2001 -From: Gilles Dartiguelongue -Date: Fri, 8 Apr 2011 15:36:35 +0200 -Subject: [PATCH 1/3] Move codegen to a non-private directory - - codegen/Makefile.am |2 +- - codegen/pygobject-codegen-2.0.in |3 ++- - pygobject-2.0.pc.in |3 ++- - 3 files changed, 5 insertions(+), 3 deletions(-) - -diff --git a/codegen/Makefile.am b/codegen/Makefile.am -index f9886eb..d714ff2 100644 a/codegen/Makefile.am -+++ b/codegen/Makefile.am -@@ -2,7 +2,7 @@ PLATFORM_VERSION = 2.0 - - bin_SCRIPTS = pygobject-codegen-$(PLATFORM_VERSION) - --codegendir = $(pkgdatadir)/$(PLATFORM_VERSION)/codegen -+codegendir = $(pyexecdir)/gtk-2.0/codegen - - codegen_SCRIPTS = \ - code-coverage.py \ -diff --git a/codegen/pygobject-codegen-2.0.in b/codegen/pygobject-codegen-2.0.in -index c5c912e..c04451b 100644 a/codegen/pygobject-codegen-2.0.in -+++ b/codegen/pygobject-codegen-2.0.in -@@ -1,9 +1,10 @@ - #!/bin/sh - - prefix=@prefix@ -+exec_prefix=@exec_prefix@ - datarootdir=@datarootdir@ - datadir=@datadir@ --codegendir=${datadir}/pygobject/2.0/codegen -+codegendir=@pyexecdir@/gtk-2.0/codegen - - PYTHONPATH=$codegendir - export PYTHONPATH -diff --git a/pygobject-2.0.pc.in b/pygobject-2.0.pc.in -index a47b685..0d1a811 100644 a/pygobject-2.0.pc.in -+++ b/pygobject-2.0.pc.in -@@ -4,6 +4,7 @@ includedir=@includedir@ - datarootdir=@datarootdir@ - datadir=@datadir@ - libdir=@libdir@ -+pyexecdir=@pyexecdir@ - - # you can use the --variable=pygtkincludedir argument to - # pkg-config to get this value. You might want to use this to -@@ -12,7 +13,7 @@ pygtkincludedir=${includedir}/pygtk-2.0 - fixxref=${datadir}/pygobject/xsl/fixxref.py - pygdocs=${datadir}/gtk-doc/html/pygobject - defsdir=${datadir}/pygobject/2.0/defs --codegendir=${datadir}/pygobject/2.0/codegen -+codegendir=${pyexecdir}/gtk-2.0/codegen - overridesdir=@pyexecdir@/gi/overrides - - Name: PyGObject --- -1.7.4.1 - diff --git a/dev-python/pygobject/files/pygobject-2.28.3-make_check.patch b/dev-python/pygobject/files/pygobject-2.28.3-make_check.patch deleted file mode 100644 index 45c04b96780..000 --- a/dev-python/pygobject/files/pygobject-2.28.3-make_check.patch +++ /dev/null @@ -1,76 +0,0 @@ -From b5c4b8b97a1ccb9a4c63ab726ea9c84d81ef51ca Mon Sep 17 00:00:00 2001 -From: Gilles Dartiguelongue -Date: Fri, 5 Nov 2010 23:39:08 +0100 -Subject: [PATCH 2/3] Do not build tests
[gentoo-commits] repo/gentoo:master commit in: dev-python/pygobject/, dev-python/pygobject/files/
commit: e5e599b190b06e3598f238324bf165f8f930de44 Author: Mart Raudsepp gentoo org> AuthorDate: Sat Dec 29 20:37:43 2018 + Commit: Mart Raudsepp gentoo org> CommitDate: Sat Dec 29 20:39:47 2018 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5e599b1 dev-python/pygobject: remove old Package-Manager: Portage-2.3.52, Repoman-2.3.12 Signed-off-by: Mart Raudsepp gentoo.org> dev-python/pygobject/Manifest | 2 - .../pygobject/files/pygobject-3.24.1-py37.patch| 255 - dev-python/pygobject/pygobject-3.22.0.ebuild | 105 - dev-python/pygobject/pygobject-3.24.1-r1.ebuild| 112 - dev-python/pygobject/pygobject-3.24.1.ebuild | 108 - 5 files changed, 582 deletions(-) diff --git a/dev-python/pygobject/Manifest b/dev-python/pygobject/Manifest index a02014a3b8b..842c7784d53 100644 --- a/dev-python/pygobject/Manifest +++ b/dev-python/pygobject/Manifest @@ -1,4 +1,2 @@ DIST pygobject-2.28.6.tar.xz 747248 BLAKE2B 5f92794034b2d0559a623db4a7d273a7dc3f099cae87ede91b17e81acac085a9298c6b81b45b4b8540b6a75ced97e474a993437dbfcfc2133d3321d6a979b541 SHA512 37544ea2377258758169b25a2969d5ee1c9ffb9b6e63e05bc7a0471a49ac9169c51ec587d4489172c7d256f53df878a81c1992a08059aa7e43dbbb69f799545c -DIST pygobject-3.22.0.tar.xz 756820 BLAKE2B 2030b9106c082bbec4418c97945df68e20f49005341ad1d7c6d390b894ac88e13f2619215df4c02587b5ccce606083906609d89c559b790777092e991afbf367 SHA512 1f6f0ea8014b35d7828a6bebc0fe2cf6519016ca5ad3819dc6b7879154d8e27fdd2971620955c8fc4904625814833c8bc8ec0599152720649864262d3b6e33e4 -DIST pygobject-3.24.1.tar.xz 758648 BLAKE2B 95e3bc6d022b70053549f8a780aa372d8964477e881b825299ca82a7328bbdab58b037a92d36578915ac622b7c223d47cc1c35fccd3ea70d7840841eaec6860d SHA512 f35968ab12b872c85af6b2410cadedcf9fa7e17352a40f3dc557c86203aa1c38753710aab9ce55e986ee2c98b64e14123c65083655445e993d0b53431db6dc93 DIST pygobject-3.28.3.tar.xz 1005368 BLAKE2B 5c24fd25fa20dbdbd3ad18d7e2eafd8f47f5e28903d9f8dab6110f09ccfc13f865149f0d4bd84bc755bc6e4191b903646930e818d85382dfaf4e05f7107b3ecf SHA512 0abda393dd774f9cea04f883eab53f5ebde81d2439ed18cfe08ef39a1996054ab34bf4e770f70116a4485fb4f9970464b9a950ffa4af76cfa21ecc8d4dff968d diff --git a/dev-python/pygobject/files/pygobject-3.24.1-py37.patch b/dev-python/pygobject/files/pygobject-3.24.1-py37.patch deleted file mode 100644 index 31250e3561c..000 --- a/dev-python/pygobject/files/pygobject-3.24.1-py37.patch +++ /dev/null @@ -1,255 +0,0 @@ -From c60ef6a2bcc05010a89328d5fc2704d1aa505e2a Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sat, 10 Mar 2018 18:04:14 +0100 -Subject: [PATCH 1/4] tests_gi: Use capture_output() context manager instead of - manually mocking stdout - - tests/helper.py | 2 +- - tests/test_gi.py | 14 +++--- - 2 files changed, 4 insertions(+), 12 deletions(-) - -diff --git a/tests/helper.py b/tests/helper.py -index c4308fee..892cb740 100644 a/tests/helper.py -+++ b/tests/helper.py -@@ -113,7 +113,7 @@ def capture_glib_deprecation_warnings(): - @contextlib.contextmanager - def capture_output(): - """ --with capture_output as (stdout, stderr): -+with capture_output() as (stdout, stderr): - some_action() - print(stdout.getvalue(), stderr.getvalue()) - """ -diff --git a/tests/test_gi.py b/tests/test_gi.py -index d0c72b64..3b77ff2d 100644 a/tests/test_gi.py -+++ b/tests/test_gi.py -@@ -13,7 +13,6 @@ import subprocess - import gc - import weakref - import warnings --from io import StringIO, BytesIO - - import gi - import gi.overrides -@@ -24,7 +23,7 @@ from gi.repository import GObject, GLib, Gio - from gi.repository import GIMarshallingTests - - from compathelper import _bytes, _unicode --from helper import capture_exceptions -+from helper import capture_exceptions, capture_output - - if sys.version_info < (3, 0): - CONSTANT_UTF8 = "const \xe2\x99\xa5 utf8" -@@ -2836,16 +2835,9 @@ class TestModule(unittest.TestCase): - self.assertTrue(hasattr(item, '__class__')) - - def test_help(self): --orig_stdout = sys.stdout --try: --if sys.version_info < (3, 0): --sys.stdout = BytesIO() --else: --sys.stdout = StringIO() -+with capture_output() as (stdout, stderr): - help(GIMarshallingTests) --output = sys.stdout.getvalue() --finally: --sys.stdout = orig_stdout -+output = stdout.getvalue() - - self.assertTrue('SimpleStruct' in output, output) - self.assertTrue('Interface2' in output, output) --- -2.18.0 - -From 1826e41cd317ba3c19cf8767b1ef8752f1865aac Mon Sep 17 00:00:00 2001 -From: Christoph Reiter -Date: Sat, 10 Mar 2018 18:54:28 +0100 -Subject: [PATCH 2/4] IntrospectionModule: __path__ should be List[str] and not - str - -This fixes a crash when calling help() on the module which got stricter with -Python 3.7. - -It's a bit
[gentoo-commits] repo/gentoo:master commit in: dev-python/pygobject/, dev-python/pygobject/files/
commit: a6c2cd5a01ebe894f0a6722909612cf971b99bc0 Author: Michał Górny gentoo org> AuthorDate: Tue Jul 24 09:29:22 2018 + Commit: Michał Górny gentoo org> CommitDate: Tue Jul 24 12:45:27 2018 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a6c2cd5a dev-python/pygobject: Backport patches for py3.7 support Closes: https://github.com/gentoo/gentoo/pull/9331 .../pygobject/files/pygobject-3.24.1-py37.patch| 255 + dev-python/pygobject/pygobject-3.24.1-r1.ebuild| 112 + 2 files changed, 367 insertions(+) diff --git a/dev-python/pygobject/files/pygobject-3.24.1-py37.patch b/dev-python/pygobject/files/pygobject-3.24.1-py37.patch new file mode 100644 index 000..31250e3561c --- /dev/null +++ b/dev-python/pygobject/files/pygobject-3.24.1-py37.patch @@ -0,0 +1,255 @@ +From c60ef6a2bcc05010a89328d5fc2704d1aa505e2a Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 10 Mar 2018 18:04:14 +0100 +Subject: [PATCH 1/4] tests_gi: Use capture_output() context manager instead of + manually mocking stdout + +--- + tests/helper.py | 2 +- + tests/test_gi.py | 14 +++--- + 2 files changed, 4 insertions(+), 12 deletions(-) + +diff --git a/tests/helper.py b/tests/helper.py +index c4308fee..892cb740 100644 +--- a/tests/helper.py b/tests/helper.py +@@ -113,7 +113,7 @@ def capture_glib_deprecation_warnings(): + @contextlib.contextmanager + def capture_output(): + """ +-with capture_output as (stdout, stderr): ++with capture_output() as (stdout, stderr): + some_action() + print(stdout.getvalue(), stderr.getvalue()) + """ +diff --git a/tests/test_gi.py b/tests/test_gi.py +index d0c72b64..3b77ff2d 100644 +--- a/tests/test_gi.py b/tests/test_gi.py +@@ -13,7 +13,6 @@ import subprocess + import gc + import weakref + import warnings +-from io import StringIO, BytesIO + + import gi + import gi.overrides +@@ -24,7 +23,7 @@ from gi.repository import GObject, GLib, Gio + from gi.repository import GIMarshallingTests + + from compathelper import _bytes, _unicode +-from helper import capture_exceptions ++from helper import capture_exceptions, capture_output + + if sys.version_info < (3, 0): + CONSTANT_UTF8 = "const \xe2\x99\xa5 utf8" +@@ -2836,16 +2835,9 @@ class TestModule(unittest.TestCase): + self.assertTrue(hasattr(item, '__class__')) + + def test_help(self): +-orig_stdout = sys.stdout +-try: +-if sys.version_info < (3, 0): +-sys.stdout = BytesIO() +-else: +-sys.stdout = StringIO() ++with capture_output() as (stdout, stderr): + help(GIMarshallingTests) +-output = sys.stdout.getvalue() +-finally: +-sys.stdout = orig_stdout ++output = stdout.getvalue() + + self.assertTrue('SimpleStruct' in output, output) + self.assertTrue('Interface2' in output, output) +-- +2.18.0 + +From 1826e41cd317ba3c19cf8767b1ef8752f1865aac Mon Sep 17 00:00:00 2001 +From: Christoph Reiter +Date: Sat, 10 Mar 2018 18:54:28 +0100 +Subject: [PATCH 2/4] IntrospectionModule: __path__ should be List[str] and not + str + +This fixes a crash when calling help() on the module which got stricter with +Python 3.7. + +It's a bit questionable why the type has __path__ in the first place as +that's only meant for packages. But let's leave that for now. +--- + gi/module.py | 5 +++-- + tests/test_gi.py | 6 -- + 2 files changed, 7 insertions(+), 4 deletions(-) + +diff --git a/gi/module.py b/gi/module.py +index fd8f5080..9e8b5256 100644 +--- a/gi/module.py b/gi/module.py +@@ -124,10 +124,11 @@ class IntrospectionModule(object): + self._version = version + self.__name__ = 'gi.repository.' + namespace + +-self.__path__ = repository.get_typelib_path(self._namespace) ++path = repository.get_typelib_path(self._namespace) ++self.__path__ = [path] + if _have_py3: + # get_typelib_path() delivers bytes, not a string +-self.__path__ = self.__path__.decode('UTF-8') ++self.__path__ = [path.decode('UTF-8')] + + if self._version is None: + self._version = repository.get_version(self._namespace) +diff --git a/tests/test_gi.py b/tests/test_gi.py +index 3b77ff2d..2fa0423d 100644 +--- a/tests/test_gi.py b/tests/test_gi.py +@@ -2813,8 +2813,10 @@ class TestKeywords(unittest.TestCase): + + class TestModule(unittest.TestCase): + def test_path(self): +- self.assertTrue(GIMarshallingTests.__path__.endswith('GIMarshallingTests-1.0.typelib'), +-GIMarshallingTests.__path__) ++path = GIMarshallingTests.__path__ ++assert isinstance(path, list) ++assert len(path) == 1 ++assert path[0].endswith('GIMarshallingTests-1.0.typelib') + + def test_str(self): + self.assertTrue("'GIMarshallingTests' from '" in