Update to 3.42.1

Use pkgconfig for BuildRequires.
This commit is contained in:
David King 2022-04-17 16:53:51 +01:00
parent cfba108217
commit f1ef507c86
3 changed files with 11 additions and 73 deletions

View File

@ -1,61 +0,0 @@
From 3d6cf72cf21fba816744702d342545265e67233f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Tue, 18 May 2021 12:31:51 +0200
Subject: [PATCH] Implement DynamicImporter.find_spec()
On Python 3.10, the code raised an ImportWarning:
ImportWarning: DynamicImporter.find_spec() not found; falling back to find_module()
See https://docs.python.org/3.10/whatsnew/3.10.html#deprecated
> Starting in this release, there will be a concerted effort to begin cleaning
> up old import semantics that were kept for Python 2.7 compatibility.
> Specifically, find_loader()/find_module() (superseded by find_spec()),
> load_module() (superseded by exec_module()), module_repr()
> (which the import system takes care of for you),
> the __package__ attribute (superseded by __spec__.parent),
> the __loader__ attribute (superseded by __spec__.loader),
> and the __cached__ attribute (superseded by __spec__.cached)
> will slowly be removed (as well as other classes and methods in importlib).
> ImportWarning and/or DeprecationWarning will be raised as appropriate to help
> identify code which needs updating during this transition.
Fixes https://gitlab.gnome.org/GNOME/pygobject/-/issues/473
---
gi/importer.py | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/gi/importer.py b/gi/importer.py
index 32967974..63788776 100644
--- a/gi/importer.py
+++ b/gi/importer.py
@@ -107,15 +107,20 @@ class DynamicImporter(object):
def __init__(self, path):
self.path = path
- def find_module(self, fullname, path=None):
+ def _find_module_check(self, fullname):
if not fullname.startswith(self.path):
- return
+ return False
path, namespace = fullname.rsplit('.', 1)
- if path != self.path:
- return
+ return path == self.path
+
+ def find_spec(self, fullname, path=None, target=None):
+ if self._find_module_check(fullname):
+ return importlib.util.spec_from_loader(fullname, self)
- return self
+ def find_module(self, fullname, path=None):
+ if self._find_module_check(fullname):
+ return self
def load_module(self, fullname):
if fullname in sys.modules:
--
GitLab

View File

@ -5,25 +5,21 @@
%define python3_version 3.4
Name: pygobject3
Version: 3.42.0
Release: 4%{?dist}
Version: 3.42.1
Release: 1%{?dist}
Summary: Python bindings for GObject Introspection
# pygobject3 emits an ImportWarning with Pyuthon 3.10.0b1+
# This patch fixes this error and can be removed once merged in upstream
# https://gitlab.gnome.org/GNOME/pygobject/-/merge_requests/174
Patch174: 174.patch
License: LGPLv2+ and MIT
URL: https://wiki.gnome.org/Projects/PyGObject
Source0: https://download.gnome.org/sources/pygobject/3.42/pygobject-%{version}.tar.xz
BuildRequires: cairo-gobject-devel
BuildRequires: glib2-devel >= %{glib2_version}
BuildRequires: gobject-introspection-devel >= %{gobject_introspection_version}
BuildRequires: pkgconfig(cairo-gobject)
BuildRequires: pkgconfig(glib-2.0) >= %{glib2_version}
BuildRequires: pkgconfig(gobject-introspection-1.0) >= %{gobject_introspection_version}
BuildRequires: pkgconfig(libffi)
BuildRequires: pkgconfig(py3cairo) >= %{pycairo_version}
BuildRequires: meson
BuildRequires: python3-devel >= %{python3_version}
BuildRequires: python3-cairo-devel >= %{pycairo_version}
BuildRequires: python3-setuptools
# https://docs.fedoraproject.org/en-US/packaging-guidelines/Python_Appendix/#_byte_compilation_reproducibility
@ -109,6 +105,9 @@ This package contains files required to embed PyGObject
%{_libdir}/pkgconfig/pygobject-3.0.pc
%changelog
* Sun Apr 17 2022 David King <amigadave@amigadave.com> - 3.42.1-1
- Update to 3.42.1
* Mon Feb 07 2022 Miro Hrončok <mhroncok@redhat.com> - 3.42.0-4
- Move pure Python modules to a noarch subpackage
- Ensure Python bytecode installed in the noarch subpackage is bit-to-bit identical

View File

@ -1 +1 @@
SHA512 (pygobject-3.42.0.tar.xz) = 2f3e9187cb8dd7ccbf139a58ea348732fc7cb95dbf4bee2ba8f78003a7540d90c0b29153d93f50bf613c2d43f0de0ec8971c61c358d48552e42ce17775a178dd
SHA512 (pygobject-3.42.1.tar.xz) = b044d395f8334057be632fd56f670ae8405d9fc375bcbd7a0a3b2dcfb8efb06bad45e62e92d2ee5432e503642dba11d6f9bf91f26bf135fa5f9a871657105a18