public inbox for libabigail@sourceware.org
 help / color / mirror / Atom feed
From: Dodji Seketeli <dodji@redhat.com>
To: libabigail@sourceware.org
Subject: [PATCH] Remove python3-mock dependency and use unittest.mock instead
Date: Fri, 26 Jan 2024 13:15:15 +0100	[thread overview]
Message-ID: <87le8c1eb0.fsf@redhat.com> (raw)

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


                 reply	other threads:[~2024-01-26 12:15 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87le8c1eb0.fsf@redhat.com \
    --to=dodji@redhat.com \
    --cc=libabigail@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).