diff --git a/0003-Allow-skipping-purl-tests-if-it-is-not-present.patch b/0003-Allow-skipping-purl-tests-if-it-is-not-present.patch new file mode 100644 index 0000000000000000000000000000000000000000..df60a1a72db2cff57f5e64bded598deca8bf312d --- /dev/null +++ b/0003-Allow-skipping-purl-tests-if-it-is-not-present.patch @@ -0,0 +1,41 @@ +From b1844f12934f7a1554fdfaf26cb05261d222a1da Mon Sep 17 00:00:00 2001 +From: Jamie Lennox +Date: Wed, 4 Dec 2019 22:16:16 +1100 +Subject: [PATCH] Allow skipping purl tests if it is not present + +Purl is not available in some packaging scenarios, like on fedora. +Easiest to just ignore this one if not present. +--- + tests/test_adapter.py | 9 ++++++++- + 1 file changed, 8 insertions(+), 1 deletion(-) + +diff --git a/tests/test_adapter.py b/tests/test_adapter.py +index 70d0752..b6aa845 100644 +--- a/tests/test_adapter.py ++++ b/tests/test_adapter.py +@@ -16,7 +16,11 @@ + import re + import urllib.parse + +-import purl ++try: ++ import purl ++except ImportError: ++ purl = None ++ + import requests + from urllib3 import HTTPResponse + +@@ -346,6 +350,9 @@ class SessionAdapterTests(base.TestCase): + self.assertEqual('resp', resp.text) + + def test_with_purl(self): ++ if purl is None: ++ self.skipTest('purl is not present') ++ + self.adapter.register_uri('GET', + purl.URL('mock://www.tester.com/a'), + text='resp') +-- +2.21.0 + diff --git a/python-requests-mock.spec b/python-requests-mock.spec index 06d4d1f7fa8554fc507ac8ca9d71b12d9692c569..73c01cd743aef1c5d358a7022bf633401e8f0a76 100644 --- a/python-requests-mock.spec +++ b/python-requests-mock.spec @@ -1,17 +1,18 @@ -%define anolis_release 2 +%define anolis_release 1 %bcond_with tests Name: python-requests-mock -Version: 1.10.0 +Version: 1.12.1 Release: %{anolis_release}%{dist} Summary: Mock out responses from the requests package License: Apache-2.0 URL: https://requests-mock.readthedocs.io/ -Source: %{pypi_source requests-mock} +Source0: https://files.pythonhosted.org/packages/source/r/requests-mock/requests-mock-1.12.1.tar.gz Patch0001: 0001-Use-system-urllib3-package.patch Patch0002: 0002-Allow-skipping-purl-tests-if-it-is-not-present.patch +Patch3: 0003-Allow-skipping-purl-tests-if-it-is-not-present.patch BuildArch: noarch @@ -19,6 +20,8 @@ BuildRequires: python3-devel %if %{with tests} BuildRequires: python3-pytest BuildRequires: python3-requests-futures +BuildRequires: python3-pytest +BuildRequires: python3-requests-futures %endif %global _description %{expand: @@ -66,6 +69,10 @@ The %{name}-doc package contains documentation files for %{name}. %doc README.rst ChangeLog %changelog +* Fri Sep 19 2025 wenyuzifang - 1.12.1-1 +- Updated to version 1.12.1 to fix xxxxxx +- Skip tests requiring optional libraries to ensure test suite portability and prevent unnecessary failures. + * Wed Mar 13 2024 Zhao Hang - 1.10.0-2 - Rebuild with python3.11 diff --git a/requests-mock-1.10.0.tar.gz b/requests-mock-1.10.0.tar.gz deleted file mode 100644 index a6d52fa7ea9087b629936c97841a498dd91e632f..0000000000000000000000000000000000000000 Binary files a/requests-mock-1.10.0.tar.gz and /dev/null differ diff --git a/requests-mock-1.12.1.tar.gz b/requests-mock-1.12.1.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..89ffa036a41d7fef309f7f60bbc87271614aa5de Binary files /dev/null and b/requests-mock-1.12.1.tar.gz differ