From 32769a94879e3658192a308ba41ebb34d8c71056 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Fri, 24 Jan 2025 08:07:44 -0500 Subject: [PATCH] Replace usage of mock with standard library version We have no need for the rolling backport, as our needs are very simple. --- .virtualenv.dev-requirements.txt | 4 ---- kiwi_stackbuild_plugin/tasks/system_stackbuild.py | 2 +- package/python-kiwi_stackbuild_plugin-spec-template | 1 - test/unit/tasks/system_stackbuild_test.py | 2 +- test/unit/tasks/system_stash_test.py | 2 +- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.virtualenv.dev-requirements.txt b/.virtualenv.dev-requirements.txt index 082692b..d68e681 100644 --- a/.virtualenv.dev-requirements.txt +++ b/.virtualenv.dev-requirements.txt @@ -14,9 +14,6 @@ pytest pytest-cov pytest-xdist -# Rolling backport of unittest.mock for all Pythons -mock - # Version-bump your software with a single command! bumpversion @@ -35,4 +32,3 @@ twine # static type checking mypy -types-mock diff --git a/kiwi_stackbuild_plugin/tasks/system_stackbuild.py b/kiwi_stackbuild_plugin/tasks/system_stackbuild.py index ec3c7bc..140b4c0 100644 --- a/kiwi_stackbuild_plugin/tasks/system_stackbuild.py +++ b/kiwi_stackbuild_plugin/tasks/system_stackbuild.py @@ -63,7 +63,7 @@ import os import sys import logging -from mock import patch +from unittest.mock import patch from docopt import docopt from typing import ( Dict, List diff --git a/package/python-kiwi_stackbuild_plugin-spec-template b/package/python-kiwi_stackbuild_plugin-spec-template index af0f61d..5cfc195 100644 --- a/package/python-kiwi_stackbuild_plugin-spec-template +++ b/package/python-kiwi_stackbuild_plugin-spec-template @@ -80,7 +80,6 @@ image root directory Summary: KIWI - Stack Build Plugin Group: Development/Languages/Python Requires: python%{python3_pkgversion}-docopt -Requires: python%{python3_pkgversion}-mock Requires: python%{python3_pkgversion}-kiwi >= 9.21.21 Requires: python%{python3_pkgversion}-setuptools diff --git a/test/unit/tasks/system_stackbuild_test.py b/test/unit/tasks/system_stackbuild_test.py index 4179bc5..f78b693 100644 --- a/test/unit/tasks/system_stackbuild_test.py +++ b/test/unit/tasks/system_stackbuild_test.py @@ -1,6 +1,6 @@ import sys from pytest import raises -from mock import ( +from unittest.mock import ( Mock, patch, call ) diff --git a/test/unit/tasks/system_stash_test.py b/test/unit/tasks/system_stash_test.py index 3a1df75..6da6737 100644 --- a/test/unit/tasks/system_stash_test.py +++ b/test/unit/tasks/system_stash_test.py @@ -1,6 +1,6 @@ import sys from pytest import raises -from mock import ( +from unittest.mock import ( Mock, patch ) from tempfile import NamedTemporaryFile