#1069939 networkd-dispatcher: please remove dependency on python3-mock

#1069939#5
Date:
2024-04-27 10:58:09 UTC
From:
To:
Dear Maintainer,

python3-mock is not usefull in a Python3-only world.

Here's a patch to remove it.

I see you are also active in the upstream repository;
so it should be trivial.

Greetings


diff --git a/debian/control b/debian/control
index 777e335..05ed46b 100644
--- a/debian/control
+++ b/debian/control
@@ -12,7 +12,6 @@ Build-Depends: asciidoc,
                iw | wireless-tools,
                python3-dbus,
                python3-gi,
-               python3-mock,
                python3-pytest,
                python3:any,
                xsltproc
diff --git a/tests/test_networkd-dispatcher.py b/tests/test_networkd-dispatcher.py
index 7b270d2..4c1cd7a 100644
--- a/tests/test_networkd-dispatcher.py
+++ b/tests/test_networkd-dispatcher.py
@@ -3,13 +3,13 @@ from collections import namedtuple
 import dbus
 import errno
 import logging
-import mock
+from unittest import mock
 import os
 import socket
 import subprocess
 import sys
 import pytest
-from mock import patch
+from unittest.mock import patch
 myPath = os.path.dirname(os.path.abspath(__file__))
 sys.path.insert(0, myPath + '/../')
 import networkd_dispatcher
diff --git a/tox.ini b/tox.ini
index 02cc761..b4fd7a3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -14,7 +14,6 @@ deps =
     pytest
     PyGObject
     pytest-cov
-    mock
 commands =
     python3 -V
     python3 -m pytest --cov=networkd_dispatcher --cov-report term-missing -q tests

#1069939#12
Date:
2026-09-10 10:54:33 UTC
From:
To:
Dear maintainer,

I've prepared an NMU for networkd-dispatcher (versioned as 2.2.4-1.2) and
uploaded it to DELAYED/15. Please feel free to tell me if I
should cancel it.

Regards.

diffstat for networkd-dispatcher-2.2.4 networkd-dispatcher-2.2.4

 changelog                 |    7 +++++++
 control                   |    1 -
 patches/remove_mock.patch |   18 ++++++++++++++++++
 patches/series            |    1 +
 4 files changed, 26 insertions(+), 1 deletion(-)

diff -Nru networkd-dispatcher-2.2.4/debian/changelog networkd-dispatcher-2.2.4/debian/changelog
--- networkd-dispatcher-2.2.4/debian/changelog	2024-07-11 14:52:59.000000000 +0200
+++ networkd-dispatcher-2.2.4/debian/changelog	2026-09-10 12:47:09.000000000 +0200
@@ -1,3 +1,10 @@
+networkd-dispatcher (2.2.4-1.2) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Patch-out usage of python3-mock (Closes: #1069939)
+
+ -- Alexandre Detiste <tchet@debian.org>  Thu, 10 Sep 2026 12:47:09 +0200
+
 networkd-dispatcher (2.2.4-1.1) unstable; urgency=medium

   * Non-maintainer upload.
diff -Nru networkd-dispatcher-2.2.4/debian/control networkd-dispatcher-2.2.4/debian/control
--- networkd-dispatcher-2.2.4/debian/control	2023-04-24 17:32:27.000000000 +0200
+++ networkd-dispatcher-2.2.4/debian/control	2026-09-10 12:47:09.000000000 +0200
@@ -12,7 +12,6 @@
                iw | wireless-tools,
                python3-dbus,
                python3-gi,
-               python3-mock,
                python3-pytest,
                python3:any,
                xsltproc
diff -Nru networkd-dispatcher-2.2.4/debian/patches/remove_mock.patch networkd-dispatcher-2.2.4/debian/patches/remove_mock.patch
--- networkd-dispatcher-2.2.4/debian/patches/remove_mock.patch	1970-01-01 01:00:00.000000000 +0100
+++ networkd-dispatcher-2.2.4/debian/patches/remove_mock.patch	2026-09-10 12:46:32.000000000 +0200
@@ -0,0 +1,18 @@
+--- a/tests/test_networkd-dispatcher.py
++++ b/tests/test_networkd-dispatcher.py
+@@ -3,13 +3,13 @@
+ import dbus
+ import errno
+ import logging
+-import mock
++from unittest import mock
+ import os
+ import socket
+ import subprocess
+ import sys
+ import pytest
+-from mock import patch
++from unittest.mock import patch
+ myPath = os.path.dirname(os.path.abspath(__file__))
+ sys.path.insert(0, myPath + '/../')
+ import networkd_dispatcher
diff -Nru networkd-dispatcher-2.2.4/debian/patches/series networkd-dispatcher-2.2.4/debian/patches/series
--- networkd-dispatcher-2.2.4/debian/patches/series	2023-04-24 17:32:27.000000000 +0200
+++ networkd-dispatcher-2.2.4/debian/patches/series	2026-09-10 12:45:55.000000000 +0200
@@ -1,2 +1,3 @@
 0001-Patch-etc-conf.d-p.conf-to-etc-default-p.patch
 0002-networkd-dispatcher.conf-Run-startup-triggers-by-def.patch
+remove_mock.patch