#7 Drop build dependency on deprecated python3-mock
Merged 2 years ago by pnemade. Opened 2 years ago by churchyard.
rpms/ churchyard/python-requests-toolbelt nomock  into  rawhide

file modified
+10 -2
@@ -3,7 +3,7 @@ 

  

  Name:           python-%{srcname}

  Version:        0.9.1

- Release:        15%{?dist}

+ Release:        16%{?dist}

  Summary:        Utility belt for advanced users of python-requests

  

  License:        ASL 2.0
@@ -30,7 +30,6 @@ 

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

  BuildRequires:  python3-betamax

- BuildRequires:  python3-mock

  BuildRequires:  python3-pyOpenSSL

  BuildRequires:  python3-pytest

  BuildRequires:  python3-requests
@@ -43,6 +42,12 @@ 

  %prep

  %autosetup -p1 -n toolbelt-%{version}

  

+ # https://fedoraproject.org/wiki/Changes/DeprecatePythonMock

+ sed -i -E -e 's/^(\s*)import mock/\1from unittest import mock/' \

+           -e 's/^(\s*)from mock import /\1from unittest.mock import /' \

+     tests/*.py tests/*/*.py

+ 

+ 

  %build

  %py3_build

  
@@ -62,6 +67,9 @@ 

  %{python3_sitelib}/%{altname}-*.egg-info/

  

  %changelog

+ * Thu Jan 06 2022 Miro Hrončok <mhroncok@redhat.com> - 0.9.1-16

+ - Drop build dependency on deprecated python3-mock

+ 

  * Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.1-15

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

  

no initial comment

Note that this is a quick and dirty way to do it, so you are unblocked for epel9. Ideally, this should be submitted upstream. See https://fedoraproject.org/wiki/Changes/DeprecatePythonMock#How_to_migrate_to_unittest.mock if upstream still supports Python 2.

Thank you for your quick reply and fix @churchyard
I will check with upstream.

Pull-Request has been merged by pnemade

2 years ago

Yes. I am not sure if I should replace this PR fix with upstream commit and build this package again or should wait for new upstream release.

I see no benefit in replacing the sed with the commit. I'd just make a note for myself to remove that sed on the next update.

Thanks for your reply. I will remove it when new upstream release is built in Fedora.

Metadata