[packages/python3-httpretty] - up to 1.1.4
baggins
baggins at pld-linux.org
Sun Apr 27 22:49:16 CEST 2025
commit caaca7890b05d1598a756b4f1b609ca974df7b0f
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Mon Apr 28 00:48:16 2025 +0200
- up to 1.1.4
python-httpretty-mock.patch | 67 --------------------
python-httpretty.spec => python3-httpretty.spec | 84 +++++--------------------
2 files changed, 17 insertions(+), 134 deletions(-)
---
diff --git a/python-httpretty.spec b/python3-httpretty.spec
similarity index 55%
rename from python-httpretty.spec
rename to python3-httpretty.spec
index 4944aa6..938307d 100644
--- a/python-httpretty.spec
+++ b/python3-httpretty.spec
@@ -1,56 +1,34 @@
#
# Conditional build:
-%bcond_without tests # unit/functional tests
+%bcond_with tests # unit/functional tests
%bcond_with doc # build Sphinx documentation (already built docs included in dist as of 0.9.7)
-%bcond_without python2 # CPython 2.x module
-%bcond_without python3 # CPython 3.x module
-%define module httpretty
+%define module httpretty
Summary: HTTP client mock for Python
Summary(pl.UTF-8): Atrapa klienta HTTP dla Pythona
-Name: python-%{module}
-# note: keep 0.9.x here for python2 support
-Version: 0.9.7
-Release: 7
+Name: python3-%{module}
+Version: 1.1.4
+Release: 1
License: MIT
Group: Libraries/Python
#Source0Download: https://pypi.org/simple/httpretty/
Source0: https://files.pythonhosted.org/packages/source/h/httpretty/httpretty-%{version}.tar.gz
-# Source0-md5: 2fc3d0dc986200be95ce8ad3ef56bc04
-Patch0: %{name}-mock.patch
+# Source0-md5: 6f00d23684900c645aba1bb46b2eb320
URL: https://httpretty.readthedocs.io/
-%if %{with python2}
-BuildRequires: python-modules >= 1:2.7
-BuildRequires: python-setuptools
-%if %{with tests}
-BuildRequires: python-coverage
-BuildRequires: python-httplib2
-BuildRequires: python-mock
-BuildRequires: python-nose
-BuildRequires: python-nose_randomly
-BuildRequires: python-rednose
-BuildRequires: python-requests
-BuildRequires: python-six >= 1.11.0
-BuildRequires: python-sure >= 1.2.24
-BuildRequires: python-tornado
-BuildRequires: python3-urllib3
-%endif
-%endif
-%if %{with python3}
BuildRequires: python3-modules >= 1:3.6
BuildRequires: python3-setuptools
%if %{with tests}
BuildRequires: python3-coverage
BuildRequires: python3-httplib2
-BuildRequires: python3-nose
-BuildRequires: python3-nose_randomly
BuildRequires: python3-rednose
BuildRequires: python3-requests
BuildRequires: python3-six >= 1.11.0
BuildRequires: python3-sure >= 1.2.24
BuildRequires: python3-tornado
BuildRequires: python3-urllib3
-%endif
+BuildRequires: python3-http3
+BuildRequires: python3-botox
+BuildRequires: python3-mock
%endif
BuildRequires: rpm-pythonprov
BuildRequires: rpmbuild(macros) >= 1.714
@@ -68,18 +46,6 @@ HTTP client mock for Python.
%description -l pl.UTF-8
Atrapa klienta HTTP dla Pythona.
-%package -n python3-%{module}
-Summary: HTTP client mock for Python
-Summary(pl.UTF-8): Atrapa klienta HTTP dla Pythona
-Group: Libraries/Python
-Requires: python3-modules >= 1:3.6
-
-%description -n python3-%{module}
-HTTP client mock for Python.
-
-%description -n python3-%{module} -l pl.UTF-8
-Atrapa klienta HTTP dla Pythona.
-
%package apidocs
Summary: API documentation for Python httpretty module
Summary(pl.UTF-8): Dokumentacja API modułu Pythona httpretty
@@ -93,15 +59,15 @@ Dokumentacja API modułu Pythona httpretty.
%prep
%setup -q -n %{module}-%{version}
-%patch -P 0 -p1
%build
-%if %{with python2}
-%py_build %{?with_tests:test}
-%endif
+%py3_build
-%if %{with python3}
-%py3_build %{?with_tests:test}
+%if %{with tests}
+# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
+PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
+PYTEST_PLUGINS= \
+%{__python3} -m pytest tests
%endif
%if %{with doc}
@@ -111,35 +77,19 @@ sphinx-build-3 -b html -d docs/build/doctrees docs/source docs/build/html
%install
rm -rf $RPM_BUILD_ROOT
-%if %{with python2}
-%py_install
-
-%py_postclean
-%endif
-
-%if %{with python3}
%py3_install
-%endif
%clean
rm -rf $RPM_BUILD_ROOT
-%if %{with python2}
%files
%defattr(644,root,root,755)
%doc COPYING README.rst
-%{py_sitescriptdir}/httpretty
-%{py_sitescriptdir}/httpretty-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-%{module}
-%defattr(644,root,root,755)
-%doc COPYING README.rst
%{py3_sitescriptdir}/httpretty
%{py3_sitescriptdir}/httpretty-%{version}-py*.egg-info
-%endif
+%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
%doc docs/build/html/{_modules,_static,*.html,*.js}
+%endif
diff --git a/python-httpretty-mock.patch b/python-httpretty-mock.patch
deleted file mode 100644
index fda09a2..0000000
--- a/python-httpretty-mock.patch
+++ /dev/null
@@ -1,67 +0,0 @@
---- httpretty-0.9.7/setup.py.orig 2018-11-04 23:34:48.000000000 +0100
-+++ httpretty-0.9.7/setup.py 2020-06-07 09:55:21.573933681 +0200
-@@ -41,7 +41,7 @@
-
-
- install_requires = ['six']
--tests_requires = ['nose', 'sure', 'coverage', 'mock', 'rednose']
-+tests_requires = ['nose', 'sure', 'coverage', 'mock;python_version<"3.2"', 'rednose']
-
-
- setup(
---- httpretty-0.9.7/tests/functional/test_fakesocket.py.orig 2018-11-04 23:34:48.000000000 +0100
-+++ httpretty-0.9.7/tests/functional/test_fakesocket.py 2020-06-07 09:57:25.379929633 +0200
-@@ -28,7 +28,10 @@
- import functools
- import socket
-
--import mock
-+try:
-+ import mock
-+except ImportError:
-+ from unittest import mock
-
-
- class FakeSocket(socket.socket):
---- httpretty-0.9.7/tests/functional/test_requests.py.orig 2019-08-26 20:41:12.000000000 +0200
-+++ httpretty-0.9.7/tests/functional/test_requests.py 2020-06-07 10:02:50.081503907 +0200
-@@ -816,7 +816,10 @@
- ("HTTPretty should call a callback function *once* and set its return value"
- " as the body of the response requests")
-
-- from mock import Mock
-+ try:
-+ from mock import Mock
-+ except ImportError:
-+ from unittest.mock import Mock
-
- def _request_callback(request, uri, headers):
- return [200, headers, "The {} response from {}".format(decode_utf8(request.method), uri)]
---- httpretty-0.9.7/tests/unit/test_core.py.orig 2019-08-26 20:41:12.000000000 +0200
-+++ httpretty-0.9.7/tests/unit/test_core.py 2020-06-07 10:04:37.994252626 +0200
-@@ -5,7 +5,10 @@
- import errno
- from datetime import datetime
-
--from mock import Mock, patch, call
-+try:
-+ from mock import Mock, patch, call
-+except ImportError:
-+ from unittest.mock import Mock, patch, call
- from sure import expect
-
- from httpretty.compat import StringIO
---- httpretty-0.9.7/tests/unit/test_main.py.orig 2019-08-26 20:41:12.000000000 +0200
-+++ httpretty-0.9.7/tests/unit/test_main.py 2020-06-07 10:05:34.600612630 +0200
-@@ -1,7 +1,10 @@
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- from __future__ import unicode_literals
--from mock import patch
-+try:
-+ from mock import patch
-+except ImportError:
-+ from unittest.mock import patch
- import httpretty
- from httpretty.core import HTTPrettyRequest
-
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-httpretty.git/commitdiff/caaca7890b05d1598a756b4f1b609ca974df7b0f
More information about the pld-cvs-commit
mailing list