From d8e1fd5db3f868e898e0cf23d6c8156d4cfd26ed Mon Sep 17 00:00:00 2001 From: DistroBaker Date: Sun, 14 Mar 2021 19:55:34 +0000 Subject: [PATCH] Merged update from upstream sources This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/python-httplib2.git#80f2108eb9e9db5993468106b235e0e2c96ee9ed --- python-httplib2.nomock.patch | 73 ++++++++++++++++++++++++++++++++++++ python-httplib2.spec | 13 +++++-- 2 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 python-httplib2.nomock.patch diff --git a/python-httplib2.nomock.patch b/python-httplib2.nomock.patch new file mode 100644 index 0000000..fae803d --- /dev/null +++ b/python-httplib2.nomock.patch @@ -0,0 +1,73 @@ +diff --git a/requirements-test.txt b/requirements-test.txt +index d208a8f..623875e 100644 +--- a/requirements-test.txt ++++ b/requirements-test.txt +@@ -1,6 +1,6 @@ + flake8==3.4.1 + future==0.16.0 +-mock==2.0.0 ++mock==2.0.0;python_version<"3.3" + pytest-cov==2.5.1 + pytest-forked==0.2 + pytest-randomly==1.2.1 +diff --git a/tests/test_cacerts_from_env.py b/tests/test_cacerts_from_env.py +index cb2bd9f..f04ba0e 100644 +--- a/tests/test_cacerts_from_env.py ++++ b/tests/test_cacerts_from_env.py +@@ -1,6 +1,9 @@ + import os + import sys +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + import pytest + import tempfile + import httplib2 +diff --git a/tests/test_http.py b/tests/test_http.py +index f61992c..65bac01 100644 +--- a/tests/test_http.py ++++ b/tests/test_http.py +@@ -5,7 +5,10 @@ from __future__ import print_function + import email.utils + import errno + import httplib2 +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + import os + import pytest + from six.moves import http_client, urllib +diff --git a/tests/test_other.py b/tests/test_other.py +index 0f450ab..6b902b9 100644 +--- a/tests/test_other.py ++++ b/tests/test_other.py +@@ -1,5 +1,8 @@ + import httplib2 +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + import os + import pickle + import pytest +diff --git a/tests/test_proxy.py b/tests/test_proxy.py +index edafe01..556b448 100644 +--- a/tests/test_proxy.py ++++ b/tests/test_proxy.py +@@ -9,7 +9,10 @@ from __future__ import division + from __future__ import print_function + + import httplib2 +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + import os + import pytest + import socket diff --git a/python-httplib2.spec b/python-httplib2.spec index 07a174a..d09d9c9 100644 --- a/python-httplib2.spec +++ b/python-httplib2.spec @@ -2,7 +2,7 @@ Name: python-%{srcname} Version: 0.19.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Comprehensive HTTP client library License: MIT URL: https://pypi.python.org/pypi/httplib2 @@ -11,6 +11,10 @@ Source: https://github.com/httplib2/httplib2/archive/v%{version}/%{srcna # Patch to use the Fedora ca certs instead of the bundled ones # Patch1: python-%{srcname}.certfile.patch +# +# Patch to use mock from the standard library, upstream PR#185 +# +Patch2: python-%{srcname}.nomock.patch BuildArch: noarch @@ -26,12 +30,10 @@ Summary: %{summary} BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pytest -BuildRequires: python3-pytest-cov BuildRequires: python3-pytest-forked BuildRequires: python3-pytest-flake8 BuildRequires: python3-pytest-timeout BuildRequires: python3-six -BuildRequires: python3-mock %description -n python3-%{srcname} %{_description} @@ -70,6 +72,11 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k "not test_unknown_server \ %{python3_sitelib}/%{srcname}/ %changelog +* Wed Mar 3 2021 Pavel Cahyna - 0.19.0-2 +- Remove unused python3-pytest-cov build dependency +- Use mock from the standard library, remove build dependency + on the deprecated python-mock package + * Sun Feb 07 2021 Kevin Fenzi - 0.19.0-1 - Update t0 0.19.0. Fixes rhbz#1925988