public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/gobject-introspection] rawhide: Fix compatibility with setuptools 84
@ 2026-08-24 10:34 Lumir Balhar
  0 siblings, 0 replies; only message in thread
From: Lumir Balhar @ 2026-08-24 10:34 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/gobject-introspection
            Branch : rawhide
            Commit : c999e8019efd6a45bc42cdbbdc677a56c76673ca
            Author : Lumir Balhar <lbalhar@redhat.com>
            Date   : 2026-08-17T07:55:27+02:00
            Stats  : +55/-0 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/gobject-introspection/c/c999e8019efd6a45bc42cdbbdc677a56c76673ca?branch=rawhide

            Log:
            Fix compatibility with setuptools 84

Assited by: Claude

---
diff --git a/fix-test-ccompiler-setuptools84.patch b/fix-test-ccompiler-setuptools84.patch
new file mode 100644
index 0000000..c1206d7
--- /dev/null
+++ b/fix-test-ccompiler-setuptools84.patch
@@ -0,0 +1,52 @@
+--- a/tests/scanner/test_ccompiler.py	2026-08-17 05:31:19.341878650 +0000
++++ b/tests/scanner/test_ccompiler.py	2026-08-17 05:45:37.094350170 +0000
+@@ -82,7 +82,9 @@
+         except ImportError as e:
+             raise unittest.SkipTest(e)
+ 
+-        with patch.object(distutils.ccompiler.CCompiler, 'spawn') as spawn:
++        # setuptools >= 84 replaced spawn() with call() -> subprocess.check_call()
++        with patch.object(distutils.ccompiler.CCompiler, 'spawn') as spawn, \
++             patch('subprocess.check_call') as check_call:
+             with Environ(environ):
+                 cc = CCompiler(compiler_name=compiler_name)
+                 # Avoid check if target is newer from source.
+@@ -90,8 +92,11 @@
+                 # Don't actually do anything.
+                 cc.compiler.dry_run = True
+                 cc.compile(pkg_config_cflags, cpp_includes, [source], init_sections)
+-        self.assertEqual(1, spawn.call_count)
+-        args, kwargs = spawn.call_args
++        if spawn.call_count:
++            args, kwargs = spawn.call_args
++            return args[0]
++        self.assertEqual(1, check_call.call_count)
++        args, kwargs = check_call.call_args
+         return args[0]
+ 
+     def preprocess_args(self, environ={}, compiler_name=None,
+@@ -103,7 +108,9 @@
+         except ImportError as e:
+             raise unittest.SkipTest(e)
+ 
+-        with patch.object(distutils.ccompiler.CCompiler, 'spawn') as spawn:
++        # setuptools >= 84 replaced spawn() with call() -> subprocess.check_call()
++        with patch.object(distutils.ccompiler.CCompiler, 'spawn') as spawn, \
++             patch('subprocess.check_call') as check_call:
+             with Environ(environ):
+                 cc = CCompiler(compiler_name=compiler_name)
+                 # Avoid check if target is newer from source.
+@@ -111,8 +118,11 @@
+                 # Don't actually do anything.
+                 cc.compiler.dry_run = True
+                 cc.preprocess(source, output, cpp_options)
+-        self.assertEqual(1, spawn.call_count)
+-        args, kwargs = spawn.call_args
++        if spawn.call_count:
++            args, kwargs = spawn.call_args
++            return args[0]
++        self.assertEqual(1, check_call.call_count)
++        args, kwargs = check_call.call_args
+         return args[0]
+ 
+     @unittest.skip("Currently a Python build time compiler is used as the default.")

diff --git a/gobject-introspection.spec b/gobject-introspection.spec
index c345388..55955c5 100644
--- a/gobject-introspection.spec
+++ b/gobject-introspection.spec
@@ -13,6 +13,9 @@ Source:         https://download.gnome.org/sources/%{name}/%{gnome_major_minor_v
 # https://bugzilla.redhat.com/show_bug.cgi?id=2208966
 Patch:          workaround.patch
 
+# Fix test_ccompiler.py for setuptools >= 84 (spawn() replaced by call() -> subprocess.check_call())
+Patch:          fix-test-ccompiler-setuptools84.patch
+
 BuildRequires:  bison
 BuildRequires:  flex
 BuildRequires:  gcc

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-24 10:34 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-24 10:34 [rpms/gobject-introspection] rawhide: Fix compatibility with setuptools 84 Lumir Balhar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox