From c9d8a119f4aaf091c77d6c448cac9c62e48872ba Mon Sep 17 00:00:00 2001 From: Jamie Lennox Date: Dec 04 2015 03:13:48 +0000 Subject: Update for v0.7.0 This includes a bunch of reworking to make it apply to fedora 23/24 python 3 changes. --- diff --git a/.gitignore b/.gitignore index 3e98218..fc81cf4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /requests-mock-0.5.1.tar.gz /requests-mock-0.6.0.tar.gz +/requests-mock-0.7.0.tar.gz diff --git a/0002-Use-system-urllib3-package.patch b/0002-Use-system-urllib3-package.patch index d148be0..03d8944 100644 --- a/0002-Use-system-urllib3-package.patch +++ b/0002-Use-system-urllib3-package.patch @@ -1,7 +1,7 @@ -From dc8138875d0ba325811d597ccadbb20ebf29b035 Mon Sep 17 00:00:00 2001 -From: Jamie Lennox -Date: Tue, 26 Aug 2014 15:25:28 +1000 -Subject: [PATCH 2/2] Use system urllib3 package +From a5030141d14c8961a926d2ed13301f6ffd67f06c Mon Sep 17 00:00:00 2001 +From: Jamie Lennox +Date: Fri, 4 Dec 2015 10:28:39 +0800 +Subject: [PATCH] Use system urllib3 package The fedora requests package uses the system urllib3 rather than the one bundled into requests. requests-mock must therefore do the same thing. @@ -12,13 +12,13 @@ Change-Id: I0af73d72e01c4fe863da21994c5350de44cd7b67 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requests_mock/response.py b/requests_mock/response.py -index 06acb95..6e66f81 100644 +index 54841fa..9457d48 100644 --- a/requests_mock/response.py +++ b/requests_mock/response.py -@@ -13,8 +13,8 @@ - import json as jsonutils - - from requests.adapters import HTTPAdapter +@@ -16,8 +16,8 @@ from requests.adapters import HTTPAdapter + from requests.cookies import MockRequest, MockResponse + from requests.cookies import RequestsCookieJar + from requests.cookies import merge_cookies, cookiejar_from_dict -from requests.packages.urllib3.response import HTTPResponse import six +from urllib3.response import HTTPResponse @@ -26,5 +26,5 @@ index 06acb95..6e66f81 100644 from requests_mock import compat from requests_mock import exceptions -- -1.9.3 +2.4.3 diff --git a/python-requests-mock.spec b/python-requests-mock.spec index 64807b7..19a3a96 100644 --- a/python-requests-mock.spec +++ b/python-requests-mock.spec @@ -8,8 +8,8 @@ %{!?_licensedir:%global license %%doc} Name: python-requests-mock -Version: 0.6.0 -Release: 3%{?dist} +Version: 0.7.0 +Release: 1%{?dist} Summary: A requests mocking tool for python License: ASL 2.0 @@ -22,6 +22,13 @@ Patch1: 0002-Use-system-urllib3-package.patch BuildArch: noarch +%description +requests-mock provides a simple way to do HTTP mocking at the +python-requests layer. + +%package -n python2-requests-mock +Summary: A requests mocking tool for python + Requires: python-requests Requires: python-six @@ -39,12 +46,15 @@ BuildRequires: python-mock BuildRequires: python-pbr BuildRequires: python-setuptools BuildRequires: python-testtools + %if 0%{?rhel} && 0%{?rhel} <= 6 BuildRequires: python-discover %endif +%{?python_provide:%python_provide python2-requests-mock} -%description + +%description -n python2-requests-mock requests-mock provides a simple way to do HTTP mocking at the python-requests layer. @@ -71,6 +81,8 @@ BuildRequires: python3-pbr BuildRequires: python3-setuptools BuildRequires: python3-testtools +%{?python_provide:%python_provide python3-requests-mock} + %description -n python3-requests-mock requests-mock provides a simple way to do HTTP mocking at the @@ -93,22 +105,22 @@ cp -a . %{py3dir} %build -%{__python2} setup.py build +%py2_build %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py build +%py3_build popd %endif %install rm -rf $RPM_BUILD_ROOT -%{__python2} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%py2_install %if 0%{?with_python3} pushd %{py3dir} -%{__python3} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT +%py3_install popd %endif @@ -140,6 +152,11 @@ popd %changelog +* Fri Dec 4 2015 Jamie Lennox - 0.7.0-1 +- Update package to new version. +- Add python2 subpackage for new python packaging guidelines. +- Redo patch1 to still apply. + * Tue Nov 10 2015 Fedora Release Engineering - 0.6.0-3 - Rebuilt for https://fedoraproject.org/wiki/Changes/python3.5 diff --git a/sources b/sources index 394c6a4..419b061 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ 6eb439313fd9c1652d6dc4c506285bec requests-mock-0.6.0.tar.gz +2486894022c6f60fa872bcf8939cadb0 requests-mock-0.7.0.tar.gz