public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Remove python3-mock dependency and use unittest.mock instead
@ 2024-01-26 12:15 Dodji Seketeli
  0 siblings, 0 replies; only message in thread
From: Dodji Seketeli @ 2024-01-26 12:15 UTC (permalink / raw)
  To: libabigail

Hello,

As explained in
https://fedoraproject.org/wiki/Changes/RemovePythonMockUsage,
python-mock is now deprecated.  We ought to use mock from the python
standard library instead.

Maxwell G submitted a patch to libabigail's Fedora package in Rawhide
at https://src.fedoraproject.org/fork/gotmax23/rpms/libabigail/c/405c5046d84fc6977c75cd42a381f7eb30b3efa7.

I am applying this patch inspired from his work here.

	* configure.ac: Do not require python-mock anymore.
	* tests/mockfedabipkgdiff.in: Use unittest.mock, not mock from
	python-mock.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
---
 configure.ac               | 2 +-
 tests/mockfedabipkgdiff.in | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 788b5620..a94255a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -764,7 +764,7 @@ if test x$CHECK_DEPS_FOR_FEDABIPKGDIFF = xyes; then
 
   REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF="\
    argparse logging os re subprocess sys $URLPARSE_MODULE \
-   xdg koji mock rpm $IMPORT_MODULE tempfile mimetypes shutil six"
+   xdg koji rpm $IMPORT_MODULE tempfile mimetypes shutil six"
 
   AX_CHECK_PYTHON_MODULES([$REQUIRED_PYTHON_MODULES_FOR_FEDABIPKGDIFF],
 			  [$PYTHON],
diff --git a/tests/mockfedabipkgdiff.in b/tests/mockfedabipkgdiff.in
index 1e562666..863cf7f6 100644
--- a/tests/mockfedabipkgdiff.in
+++ b/tests/mockfedabipkgdiff.in
@@ -42,7 +42,7 @@ import tempfile
 import six
 
 try:
-    from mock import patch
+    from unittest.mock import patch
 except ImportError:
     import sys
     six.print_('mock is required to run tests. Please install before running'
-- 
2.39.3


-- 
		Dodji


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

only message in thread, other threads:[~2024-01-26 12:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-26 12:15 [PATCH] Remove python3-mock dependency and use unittest.mock instead Dodji Seketeli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).