Accepting request 855338 from home:mcepl:branches:devel:tools:scm
- Add remove_mock.patch to remove dependency on the external mock package (gh#pypa/pip#9266). OBS-URL: https://build.opensuse.org/request/show/855338 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-pip?expand=0&rev=87
This commit is contained in:
parent
ec091103ec
commit
ab39133ac8
@ -1,3 +1,9 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri Dec 11 22:13:56 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Add remove_mock.patch to remove dependency on the external mock
|
||||||
|
package (gh#pypa/pip#9266).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Nov 16 16:37:45 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
Mon Nov 16 16:37:45 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
@ -42,6 +42,9 @@ URL: http://www.pip-installer.org
|
|||||||
Source: https://github.com/pypa/pip/archive/%{version}.tar.gz#/pip-%{version}-gh.tar.gz
|
Source: https://github.com/pypa/pip/archive/%{version}.tar.gz#/pip-%{version}-gh.tar.gz
|
||||||
# PATCH-FIX-OPENSUSE pip-shipped-requests-cabundle.patch -- adapted patch from python-certifi package
|
# PATCH-FIX-OPENSUSE pip-shipped-requests-cabundle.patch -- adapted patch from python-certifi package
|
||||||
Patch0: pip-shipped-requests-cabundle.patch
|
Patch0: pip-shipped-requests-cabundle.patch
|
||||||
|
# PATCH-FIX-UPSTREAM remove_mock.patch gh#pypa/pip#9266 mcepl@suse.com
|
||||||
|
# remove dependency on the external module mock
|
||||||
|
Patch1: remove_mock.patch
|
||||||
BuildRequires: %{python_module setuptools >= 40.8.0}
|
BuildRequires: %{python_module setuptools >= 40.8.0}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
@ -61,7 +64,6 @@ BuildRequires: %{python_module cryptography}
|
|||||||
BuildRequires: %{python_module csv23}
|
BuildRequires: %{python_module csv23}
|
||||||
BuildRequires: %{python_module docutils}
|
BuildRequires: %{python_module docutils}
|
||||||
BuildRequires: %{python_module freezegun}
|
BuildRequires: %{python_module freezegun}
|
||||||
BuildRequires: %{python_module mock}
|
|
||||||
BuildRequires: %{python_module pretend}
|
BuildRequires: %{python_module pretend}
|
||||||
BuildRequires: %{python_module pytest}
|
BuildRequires: %{python_module pytest}
|
||||||
BuildRequires: %{python_module scripttest}
|
BuildRequires: %{python_module scripttest}
|
||||||
@ -83,10 +85,10 @@ finding packages, so packages that were made easy_installable should be
|
|||||||
pip-installable as well.
|
pip-installable as well.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pip-%{version}
|
|
||||||
# Unbundling is not advised by upstream. See src/pip/_vendor/README.rst
|
# Unbundling is not advised by upstream. See src/pip/_vendor/README.rst
|
||||||
# Exception: Use our own cabundle. Adapted patch from python-certifi package
|
# Exception: Use our own cabundle. Adapted patch from python-certifi package
|
||||||
%patch0 -p1
|
%autosetup -p1 -n pip-%{version}
|
||||||
|
|
||||||
rm src/pip/_vendor/certifi/cacert.pem
|
rm src/pip/_vendor/certifi/cacert.pem
|
||||||
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
|
296
remove_mock.patch
Normal file
296
remove_mock.patch
Normal file
@ -0,0 +1,296 @@
|
|||||||
|
---
|
||||||
|
tests/functional/test_help.py | 2 +-
|
||||||
|
tests/lib/server.py | 2 +-
|
||||||
|
tests/unit/resolution_resolvelib/test_resolver.py | 2 +-
|
||||||
|
tests/unit/test_base_command.py | 2 +-
|
||||||
|
tests/unit/test_check.py | 2 +-
|
||||||
|
tests/unit/test_collector.py | 4 ++--
|
||||||
|
tests/unit/test_command_install.py | 2 +-
|
||||||
|
tests/unit/test_commands.py | 2 +-
|
||||||
|
tests/unit/test_configuration.py | 2 +-
|
||||||
|
tests/unit/test_direct_url_helpers.py | 2 +-
|
||||||
|
tests/unit/test_finder.py | 2 +-
|
||||||
|
tests/unit/test_locations.py | 2 +-
|
||||||
|
tests/unit/test_logging.py | 2 +-
|
||||||
|
tests/unit/test_network_cache.py | 2 +-
|
||||||
|
tests/unit/test_operations_prepare.py | 2 +-
|
||||||
|
tests/unit/test_req.py | 2 +-
|
||||||
|
tests/unit/test_req_file.py | 2 +-
|
||||||
|
tests/unit/test_req_uninstall.py | 2 +-
|
||||||
|
tests/unit/test_resolution_legacy_resolver.py | 4 ++--
|
||||||
|
tests/unit/test_target_python.py | 2 +-
|
||||||
|
tests/unit/test_utils.py | 2 +-
|
||||||
|
tests/unit/test_utils_compatibility_tags.py | 2 +-
|
||||||
|
tests/unit/test_vcs.py | 2 +-
|
||||||
|
tests/unit/test_wheel.py | 2 +-
|
||||||
|
tests/unit/test_wheel_builder.py | 2 +-
|
||||||
|
25 files changed, 27 insertions(+), 27 deletions(-)
|
||||||
|
|
||||||
|
--- a/tests/lib/server.py
|
||||||
|
+++ b/tests/lib/server.py
|
||||||
|
@@ -5,7 +5,7 @@ import threading
|
||||||
|
from contextlib import contextmanager
|
||||||
|
from textwrap import dedent
|
||||||
|
|
||||||
|
-from mock import Mock
|
||||||
|
+from unittest.mock import Mock
|
||||||
|
from pip._vendor.contextlib2 import nullcontext
|
||||||
|
from werkzeug.serving import WSGIRequestHandler
|
||||||
|
from werkzeug.serving import make_server as _make_server
|
||||||
|
--- a/tests/unit/test_base_command.py
|
||||||
|
+++ b/tests/unit/test_base_command.py
|
||||||
|
@@ -3,7 +3,7 @@ import os
|
||||||
|
import time
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock, patch
|
||||||
|
+from unittest.mock import Mock, patch
|
||||||
|
|
||||||
|
from pip._internal.cli.base_command import Command
|
||||||
|
from pip._internal.cli.status_codes import SUCCESS
|
||||||
|
--- a/tests/unit/test_commands.py
|
||||||
|
+++ b/tests/unit/test_commands.py
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
|
||||||
|
from pip._internal.cli.req_command import (
|
||||||
|
IndexGroupCommand,
|
||||||
|
--- a/tests/unit/test_network_cache.py
|
||||||
|
+++ b/tests/unit/test_network_cache.py
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock
|
||||||
|
+from unittest.mock import Mock
|
||||||
|
from pip._vendor.cachecontrol.caches import FileCache
|
||||||
|
|
||||||
|
from pip._internal.network.cache import SafeFileCache
|
||||||
|
--- a/tests/unit/test_req_file.py
|
||||||
|
+++ b/tests/unit/test_req_file.py
|
||||||
|
@@ -5,7 +5,7 @@ import subprocess
|
||||||
|
import textwrap
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
from pip._vendor.six import PY2
|
||||||
|
from pretend import stub
|
||||||
|
|
||||||
|
--- a/tests/unit/test_resolution_legacy_resolver.py
|
||||||
|
+++ b/tests/unit/test_resolution_legacy_resolver.py
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
import logging
|
||||||
|
|
||||||
|
-import mock
|
||||||
|
+import unittest.mock as mock
|
||||||
|
import pytest
|
||||||
|
from pip._vendor import pkg_resources
|
||||||
|
|
||||||
|
--- a/tests/unit/test_target_python.py
|
||||||
|
+++ b/tests/unit/test_target_python.py
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
|
||||||
|
from pip._internal.models.target_python import TargetPython
|
||||||
|
from tests.lib import CURRENT_PY_VERSION_INFO, pyversion
|
||||||
|
--- a/tests/unit/test_utils.py
|
||||||
|
+++ b/tests/unit/test_utils.py
|
||||||
|
@@ -14,7 +14,7 @@ import time
|
||||||
|
from io import BytesIO
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock, patch
|
||||||
|
+from unittest.mock import Mock, patch
|
||||||
|
|
||||||
|
from pip._internal.exceptions import (
|
||||||
|
HashMismatch,
|
||||||
|
--- a/tests/unit/test_utils_compatibility_tags.py
|
||||||
|
+++ b/tests/unit/test_utils_compatibility_tags.py
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
import sysconfig
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
|
||||||
|
from pip._internal.utils import compatibility_tags
|
||||||
|
|
||||||
|
--- a/tests/unit/test_vcs.py
|
||||||
|
+++ b/tests/unit/test_vcs.py
|
||||||
|
@@ -2,7 +2,7 @@ import os
|
||||||
|
from unittest import TestCase
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
from pip._vendor.packaging.version import parse as parse_version
|
||||||
|
|
||||||
|
from pip._internal.exceptions import BadCommand, InstallationError
|
||||||
|
--- a/tests/unit/test_wheel.py
|
||||||
|
+++ b/tests/unit/test_wheel.py
|
||||||
|
@@ -8,7 +8,7 @@ import textwrap
|
||||||
|
from email import message_from_string
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
from pip._vendor.packaging.requirements import Requirement
|
||||||
|
|
||||||
|
from pip._internal.exceptions import InstallationError
|
||||||
|
--- a/tests/unit/test_wheel_builder.py
|
||||||
|
+++ b/tests/unit/test_wheel_builder.py
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
import logging
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
|
||||||
|
from pip._internal import wheel_builder
|
||||||
|
from pip._internal.models.link import Link
|
||||||
|
--- a/tests/functional/test_help.py
|
||||||
|
+++ b/tests/functional/test_help.py
|
||||||
|
@@ -1,5 +1,5 @@
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock
|
||||||
|
+from unittest.mock import Mock
|
||||||
|
|
||||||
|
from pip._internal.cli.status_codes import ERROR, SUCCESS
|
||||||
|
from pip._internal.commands import commands_dict, create_command
|
||||||
|
--- a/tests/unit/resolution_resolvelib/test_resolver.py
|
||||||
|
+++ b/tests/unit/resolution_resolvelib/test_resolver.py
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-import mock
|
||||||
|
+import unittest.mock as mock
|
||||||
|
import pytest
|
||||||
|
from pip._vendor.packaging.utils import canonicalize_name
|
||||||
|
from pip._vendor.resolvelib.resolvers import Result
|
||||||
|
--- a/tests/unit/test_check.py
|
||||||
|
+++ b/tests/unit/test_check.py
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
"""Unit Tests for pip's dependency checking logic
|
||||||
|
"""
|
||||||
|
|
||||||
|
-import mock
|
||||||
|
+import unittest.mock as mock
|
||||||
|
|
||||||
|
from pip._internal.operations import check
|
||||||
|
|
||||||
|
--- a/tests/unit/test_collector.py
|
||||||
|
+++ b/tests/unit/test_collector.py
|
||||||
|
@@ -4,10 +4,10 @@ import re
|
||||||
|
import uuid
|
||||||
|
from textwrap import dedent
|
||||||
|
|
||||||
|
-import mock
|
||||||
|
+import unittest.mock as mock
|
||||||
|
import pretend
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock, patch
|
||||||
|
+from unittest.mock import Mock, patch
|
||||||
|
from pip._vendor import html5lib, requests
|
||||||
|
from pip._vendor.six.moves.urllib import request as urllib_request
|
||||||
|
|
||||||
|
--- a/tests/unit/test_command_install.py
|
||||||
|
+++ b/tests/unit/test_command_install.py
|
||||||
|
@@ -1,7 +1,7 @@
|
||||||
|
import errno
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
from pip._vendor.packaging.requirements import Requirement
|
||||||
|
|
||||||
|
from pip._internal.commands.install import (
|
||||||
|
--- a/tests/unit/test_configuration.py
|
||||||
|
+++ b/tests/unit/test_configuration.py
|
||||||
|
@@ -4,7 +4,7 @@
|
||||||
|
import os
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import MagicMock
|
||||||
|
+from unittest.mock import MagicMock
|
||||||
|
|
||||||
|
from pip._internal.configuration import get_configuration_files, kinds
|
||||||
|
from pip._internal.exceptions import ConfigurationError
|
||||||
|
--- a/tests/unit/test_direct_url_helpers.py
|
||||||
|
+++ b/tests/unit/test_direct_url_helpers.py
|
||||||
|
@@ -1,6 +1,6 @@
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
|
-from mock import MagicMock, patch
|
||||||
|
+from unittest.mock import MagicMock, patch
|
||||||
|
|
||||||
|
from pip._internal.models.direct_url import (
|
||||||
|
DIRECT_URL_METADATA_NAME,
|
||||||
|
--- a/tests/unit/test_finder.py
|
||||||
|
+++ b/tests/unit/test_finder.py
|
||||||
|
@@ -2,7 +2,7 @@ import logging
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock, patch
|
||||||
|
+from unittest.mock import Mock, patch
|
||||||
|
from pip._vendor.packaging.specifiers import SpecifierSet
|
||||||
|
from pip._vendor.packaging.tags import Tag
|
||||||
|
from pkg_resources import parse_version
|
||||||
|
--- a/tests/unit/test_locations.py
|
||||||
|
+++ b/tests/unit/test_locations.py
|
||||||
|
@@ -9,7 +9,7 @@ import sys
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock
|
||||||
|
+from unittest.mock import Mock
|
||||||
|
|
||||||
|
from pip._internal.locations import distutils_scheme
|
||||||
|
|
||||||
|
--- a/tests/unit/test_logging.py
|
||||||
|
+++ b/tests/unit/test_logging.py
|
||||||
|
@@ -5,7 +5,7 @@ import time
|
||||||
|
from threading import Thread
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
from pip._vendor.six import PY2
|
||||||
|
|
||||||
|
from pip._internal.utils.logging import (
|
||||||
|
--- a/tests/unit/test_operations_prepare.py
|
||||||
|
+++ b/tests/unit/test_operations_prepare.py
|
||||||
|
@@ -4,7 +4,7 @@ from shutil import rmtree
|
||||||
|
from tempfile import mkdtemp
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock, patch
|
||||||
|
+from unittest.mock import Mock, patch
|
||||||
|
|
||||||
|
from pip._internal.exceptions import HashMismatch
|
||||||
|
from pip._internal.models.link import Link
|
||||||
|
--- a/tests/unit/test_req.py
|
||||||
|
+++ b/tests/unit/test_req.py
|
||||||
|
@@ -6,7 +6,7 @@ import tempfile
|
||||||
|
from functools import partial
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import patch
|
||||||
|
+from unittest.mock import patch
|
||||||
|
from pip._vendor import pkg_resources
|
||||||
|
from pip._vendor.packaging.markers import Marker
|
||||||
|
from pip._vendor.packaging.requirements import Requirement
|
||||||
|
--- a/tests/unit/test_req_uninstall.py
|
||||||
|
+++ b/tests/unit/test_req_uninstall.py
|
||||||
|
@@ -2,7 +2,7 @@ import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
-from mock import Mock
|
||||||
|
+from unittest.mock import Mock
|
||||||
|
|
||||||
|
import pip._internal.req.req_uninstall
|
||||||
|
from pip._internal.req.req_uninstall import (
|
Loading…
Reference in New Issue
Block a user