- Update to 0.3.11:
* Performance improvements * Fix nesting time.time * Add nanosecond property - Remove nose dependency by adding denose.patch - Remove superfluous devel dependency for noarch package OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-freezegun?expand=0&rev=17
This commit is contained in:
parent
78f7ef5367
commit
5f7003500d
@ -1,55 +0,0 @@
|
|||||||
From 4fdad69659f15a9e62cf4f6c15c9f319276cf9b0 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Jonas Obrist <jonas.obrist@hde.co.jp>
|
|
||||||
Date: Tue, 6 Mar 2018 12:21:38 +0900
|
|
||||||
Subject: [PATCH] add support for Python 3.7 uuid module changes
|
|
||||||
|
|
||||||
Python 3.7 removed uuid._uuid_generate_time. It now has
|
|
||||||
uuid._load_system_functions and uuid._generate_time_safe.
|
|
||||||
_generate_time_safe is set by calling _load_system_functions (subsequent
|
|
||||||
calls to that function are no-op). This change detects the missing
|
|
||||||
uuid._uuid_generate_time attribute and uses the new attribute/function
|
|
||||||
if they're missing.
|
|
||||||
---
|
|
||||||
freezegun/api.py | 14 +++++++++++---
|
|
||||||
1 file changed, 11 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/freezegun/api.py b/freezegun/api.py
|
|
||||||
index eb09932..a88a392 100644
|
|
||||||
--- a/freezegun/api.py
|
|
||||||
+++ b/freezegun/api.py
|
|
||||||
@@ -27,8 +27,14 @@
|
|
||||||
|
|
||||||
try:
|
|
||||||
real_uuid_generate_time = uuid._uuid_generate_time
|
|
||||||
-except (AttributeError, ImportError):
|
|
||||||
+ uuid_generate_time_attr = '_uuid_generate_time'
|
|
||||||
+except AttributeError:
|
|
||||||
+ uuid._load_system_functions()
|
|
||||||
+ real_uuid_generate_time = uuid._generate_time_safe
|
|
||||||
+ uuid_generate_time_attr = '_generate_time_safe'
|
|
||||||
+except ImportError:
|
|
||||||
real_uuid_generate_time = None
|
|
||||||
+ uuid_generate_time_attr = None
|
|
||||||
|
|
||||||
try:
|
|
||||||
real_uuid_create = uuid._UuidCreate
|
|
||||||
@@ -482,7 +488,8 @@ def start(self):
|
|
||||||
time.localtime = fake_localtime
|
|
||||||
time.gmtime = fake_gmtime
|
|
||||||
time.strftime = fake_strftime
|
|
||||||
- uuid._uuid_generate_time = None
|
|
||||||
+ if uuid_generate_time_attr:
|
|
||||||
+ setattr(uuid, uuid_generate_time_attr, None)
|
|
||||||
uuid._UuidCreate = None
|
|
||||||
uuid._last_timestamp = None
|
|
||||||
|
|
||||||
@@ -573,7 +580,8 @@ def stop(self):
|
|
||||||
time.localtime = time.localtime.previous_localtime_function
|
|
||||||
time.strftime = time.strftime.previous_strftime_function
|
|
||||||
|
|
||||||
- uuid._uuid_generate_time = real_uuid_generate_time
|
|
||||||
+ if uuid_generate_time_attr:
|
|
||||||
+ setattr(uuid, uuid_generate_time_attr, real_uuid_generate_time)
|
|
||||||
uuid._UuidCreate = real_uuid_create
|
|
||||||
uuid._last_timestamp = None
|
|
||||||
|
|
1150
denose.patch
Normal file
1150
denose.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:703caac155dcaad61f78de4cb0666dca778d854dfb90b3699930adee0559a622
|
|
||||||
size 20398
|
|
3
freezegun-0.3.11.tar.gz
Normal file
3
freezegun-0.3.11.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:e839b43bfbe8158b4d62bb97e6313d39f3586daf48e1314fb1083d2ef17700da
|
||||||
|
size 23382
|
@ -1,3 +1,17 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jan 10 14:29:14 CET 2019 - mcepl@suse.com
|
||||||
|
|
||||||
|
- Update to 0.3.11:
|
||||||
|
* Performance improvements
|
||||||
|
* Fix nesting time.time
|
||||||
|
* Add nanosecond property
|
||||||
|
- Remove nose dependency by adding denose.patch
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Dec 4 12:48:13 UTC 2018 - Matej Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
- Remove superfluous devel dependency for noarch package
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue Sep 4 16:32:05 UTC 2018 - Matěj Cepl <mcepl@suse.com>
|
Tue Sep 4 16:32:05 UTC 2018 - Matěj Cepl <mcepl@suse.com>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-freezegun
|
# spec file for package python-freezegun
|
||||||
#
|
#
|
||||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -12,24 +12,23 @@
|
|||||||
# license that conforms to the Open Source Definition (Version 1.9)
|
# license that conforms to the Open Source Definition (Version 1.9)
|
||||||
# published by the Open Source Initiative.
|
# published by the Open Source Initiative.
|
||||||
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||||
%bcond_without tests
|
|
||||||
Name: python-freezegun
|
Name: python-freezegun
|
||||||
Version: 0.3.10
|
Version: 0.3.11
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Mock time date for Python
|
Summary: Mock time date for Python
|
||||||
License: Apache-2.0
|
License: Apache-2.0
|
||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/spulec/freezegun
|
URL: https://github.com/spulec/freezegun
|
||||||
Source: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz
|
||||||
Patch0: _u_p37_tests.patch
|
# gh#spulec/freezegun#259
|
||||||
# https://github.com/spulec/freezegun/issues/259
|
Patch0: remove_dependency_on_mock.patch
|
||||||
Patch1: remove_dependency_on_mock.patch
|
# gh#spulec/freezegun#280 Removal of nose dependency
|
||||||
BuildRequires: %{python_module devel}
|
Patch1: denose.patch
|
||||||
BuildRequires: %{python_module python-dateutil > 2.0}
|
BuildRequires: %{python_module python-dateutil > 2.0}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
BuildRequires: %{python_module six}
|
BuildRequires: %{python_module six}
|
||||||
@ -38,10 +37,7 @@ BuildRequires: python-rpm-macros
|
|||||||
Requires: python-python-dateutil > 2.0
|
Requires: python-python-dateutil > 2.0
|
||||||
Requires: python-six
|
Requires: python-six
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%if %{with tests}
|
|
||||||
BuildRequires: %{python_module nose}
|
|
||||||
BuildRequires: python2-mock
|
BuildRequires: python2-mock
|
||||||
%endif
|
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@ -59,10 +55,8 @@ time by mocking the datetime module.
|
|||||||
%python_install
|
%python_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
|
||||||
%if %{with tests}
|
|
||||||
%check
|
%check
|
||||||
%python_expand nosetests-%{$python_bin_suffix}
|
%python_exec -munittest discover -v
|
||||||
%endif
|
|
||||||
|
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user