[packages/python3-requests-mock] 1.12.1

arekm arekm at pld-linux.org
Fri Mar 14 22:25:33 CET 2025


commit b7d6826bb9876f15b5c08c61df29764bf0fe4274
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Fri Mar 14 22:22:20 2025 +0100

    1.12.1

 python-requests-mock-no-git.patch => no-git.patch  |   0
 ...equests-mock.spec => python3-requests-mock.spec | 101 ++++-----------------
 2 files changed, 16 insertions(+), 85 deletions(-)
---
diff --git a/python-requests-mock.spec b/python3-requests-mock.spec
similarity index 51%
rename from python-requests-mock.spec
rename to python3-requests-mock.spec
index bbb7f9d..7da7a8f 100644
--- a/python-requests-mock.spec
+++ b/python3-requests-mock.spec
@@ -2,48 +2,28 @@
 # Conditional build:
 %bcond_without	doc	# API documentation
 %bcond_without	tests	# unit tests
-%bcond_without	python2 # CPython 2.x module
-%bcond_without	python3 # CPython 3.x module
 
 %define		module		requests_mock
 %define		egg_name	%{module}
 %define		pypi_name	requests-mock
 Summary:	Mock out responses from the requests package
 Summary(pl.UTF-8):	Podstawianie atrap odpowiedzi z pakietu requests
-Name:		python-%{pypi_name}
-Version:	1.11.0
-Release:	3
+Name:		python3-%{pypi_name}
+Version:	1.12.1
+Release:	1
 License:	Apache v2.0
 Group:		Libraries/Python
 #Source0Download: https://pypi.org/simple/requests-mock/
 Source0:	https://files.pythonhosted.org/packages/source/r/requests-mock/%{pypi_name}-%{version}.tar.gz
-# Source0-md5:	04be84aa5fdc94fde14e57da1965c85d
-Patch1:		%{name}-no-git.patch
+# Source0-md5:	84a910e415291bf1d986aa50c0c3eedb
+Patch1:		no-git.patch
 URL:		https://requests-mock.readthedocs.io/
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.714
-%if %{with python2}
-BuildRequires:	python-modules >= 1:2.7
-BuildRequires:	python-pbr
-BuildRequires:	python-setuptools
-%if %{with tests}
-BuildRequires:	python-fixtures
-BuildRequires:	python-mock
-BuildRequires:	python-purl
-BuildRequires:	python-pytest
-BuildRequires:	python-requests >= 2.3
-BuildRequires:	python-requests-futures
-BuildRequires:	python-six
-BuildRequires:	python-subunit
-BuildRequires:	python-testrepository >= 0.0.18
-BuildRequires:	python-testtools
-BuildRequires:	subunit-python2
-%endif
-%endif
-%if %{with python3}
 BuildRequires:	python3-modules >= 1:3.4
 BuildRequires:	python3-pbr
-BuildRequires:	python3-setuptools
+BuildRequires:	python3-build
+BuildRequires:	python3-installer
 %if %{with tests}
 BuildRequires:	python3-fixtures
 BuildRequires:	python3-purl
@@ -56,12 +36,11 @@ BuildRequires:	python3-testrepository >= 0.0.18
 BuildRequires:	python3-testtools
 BuildRequires:	subunit-python3
 %endif
-%endif
 %if %{with doc}
 BuildRequires:	python3-reno
 BuildRequires:	sphinx-pdg-3
 %endif
-Requires:	python-modules >= 1:2.7
+Requires:	python3-modules >= 1:3.8
 BuildArch:	noarch
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -73,20 +52,6 @@ portions of your testing code.
 Pakiet requests-mock udostępnia blok do tworzenia zaślepek żądań HTTP
 w kodzie testowym.
 
-%package -n python3-%{pypi_name}
-Summary:	Mock out responses from the requests package
-Summary(pl.UTF-8):	Podstawianie atrap odpowiedzi z pakietu requests
-Group:		Libraries/Python
-Requires:	python3-modules >= 1:3.4
-
-%description -n python3-%{pypi_name}
-requests-mock provides a building block to stub out the HTTP requests
-portions of your testing code.
-
-%description -n python3-%{pypi_name} -l pl.UTF-8
-Pakiet requests-mock udostępnia blok do tworzenia zaślepek żądań HTTP
-w kodzie testowym.
-
 %package apidocs
 Summary:	API documentation for requests_mock module
 Summary(pl.UTF-8):	Dokumentacja API modułu requests_mock
@@ -103,30 +68,14 @@ Dokumentacja API modułu requests_mock.
 %patch -P 1 -p1
 
 %build
-%if %{with python2}
-%py_build
+%py3_build_pyproject
 
 %if %{with tests}
+%{__python3} -m zipfile -e build-3/*.whl build-3-test
+# use explicit plugins list for reliable builds (delete PYTEST_PLUGINS if empty)
 PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS=requests_mock.contrib._pytest_plugin \
-PYTHONPATH=$(pwd) \
-%{__python} -m pytest tests/pytest
-
-%{__python} -m subunit.run discover | subunit2pyunit-2
-%endif
-%endif
-
-%if %{with python3}
-%py3_build
-
-%if %{with tests}
-PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 \
-PYTEST_PLUGINS=requests_mock.contrib._pytest_plugin \
-PYTHONPATH=$(pwd) \
-%{__python3} -m pytest tests/pytest
-
-%{__python3} -m subunit.run discover | subunit2pyunit-3
-%endif
+PYTEST_PLUGINS= \
+%{__python3} -m pytest -o pythonpath="$PWD/build-3-test" tests
 %endif
 
 %if %{with doc}
@@ -140,34 +89,16 @@ sphinx-build-3 -b html doc/source doc/_build/html
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
-%py_install
-
-%py_postclean
-%endif
-
-%if %{with python3}
-%py3_install
-%endif
+%py3_install_pyproject
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%if %{with python2}
 %files
 %defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README.rst
-%{py_sitescriptdir}/%{module}
-%{py_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
-%endif
-
-%if %{with python3}
-%files -n python3-%{pypi_name}
-%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README.rst
+%doc README.rst
 %{py3_sitescriptdir}/%{module}
-%{py3_sitescriptdir}/%{egg_name}-%{version}-py*.egg-info
-%endif
+%{py3_sitescriptdir}/%{egg_name}-%{version}.dist-info
 
 %if %{with doc}
 %files apidocs
diff --git a/python-requests-mock-no-git.patch b/no-git.patch
similarity index 100%
rename from python-requests-mock-no-git.patch
rename to no-git.patch
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/python3-requests-mock.git/commitdiff/b7d6826bb9876f15b5c08c61df29764bf0fe4274



More information about the pld-cvs-commit mailing list