#4 drop python-mock dependency
Closed 2 years ago by stevetraylen. Opened 2 years ago by sbonazzo.
rpms/ sbonazzo/python-humanize rawhide  into  rawhide

@@ -0,0 +1,44 @@ 

+ From ad281e93a4148c1fea8d53d9343a6a1fa3b1c8be Mon Sep 17 00:00:00 2001

+ From: Sandro Bonazzola <sbonazzo@redhat.com>

+ Date: Wed, 24 Nov 2021 18:03:24 +0100

+ Subject: [PATCH] test: move from mock to unittest.mock

+ 

+ Dropped python-mock, mock is part of unittest in the standard library

+ since Python 3.3.

+ 

+ Using the unittest module from the standard library instead.

+ 

+ Signed-off-by: Sandro Bonazzola <sbonazzo@redhat.com>

+ ---

+  setup.py      | 1 -

+  tests/time.py | 2 +-

+  2 files changed, 1 insertion(+), 2 deletions(-)

+ 

+ diff --git a/setup.py b/setup.py

+ index 327388d..4f59508 100644

+ --- a/setup.py

+ +++ b/setup.py

+ @@ -36,7 +36,6 @@ setup(

+      include_package_data=True,

+      zip_safe=False,

+      test_suite="tests",

+ -    tests_require=['mock'],

+      install_requires=[

+        # -*- Extra requirements: -*-

+      ],

+ diff --git a/tests/time.py b/tests/time.py

+ index 7747c87..16cab49 100644

+ --- a/tests/time.py

+ +++ b/tests/time.py

+ @@ -3,7 +3,7 @@

+  

+  """Tests for time humanizing."""

+  

+ -from mock import patch

+ +from unittest.mock import patch

+  

+  from humanize import time

+  from datetime import date, datetime, timedelta

+ -- 

+ 2.27.0

+ 

file modified
+6 -4
@@ -2,19 +2,17 @@ 

  

  Name:           python-humanize

  Version:        0.5.1

- Release:        27%{?dist}

+ Release:        28%{?dist}

  Summary:        Turns dates in to human readable format, e.g '3 minutes ago'

  

  License:        MIT

  URL:            https://github.com/jmoiron/humanize

  Source0:        %{url}/archive/%{version}.tar.gz

+ Patch0:         0001-test-move-from-mock-to-unittest.mock.patch

  

  BuildArch:      noarch

  BuildRequires:  python3-devel

  BuildRequires:  python3-setuptools

- %if %{with check}

- BuildRequires:  python3-mock

- %endif

  

  

  %global _description\
@@ -36,6 +34,7 @@ 

  

  %prep

  %setup -q -n humanize-%{version}

+ %patch0 -p1

  

  # Remove shebangs from libs.

  for lib in humanize/time.py humanize/filesize.py humanize/number.py; do
@@ -70,6 +69,9 @@ 

  %exclude %{python3_sitelib}/humanize/locale/*/LC_MESSAGES/*.po

  

  %changelog

+ * Wed Nov 24 2021 Sandro Bonazzola <sbonazzo@redhat.com> - 0.5.1-28

+ - drop python-mock dependency

+ 

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

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

  

test: move from mock to unittest.mock

Dropped python-mock, mock is part of unittest in the standard library
since Python 3.3.

Using the unittest module from the standard library instead.

rebased onto 74de1dd

2 years ago

@python-maint can you please review?

Pull-Request has been closed by stevetraylen

2 years ago