Hello community, here is the log from the commit of package python-freezegun for openSUSE:Factory checked in at 2020-10-23 12:18:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-freezegun (Old) and /work/SRC/openSUSE:Factory/.python-freezegun.new.3463 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-freezegun" Fri Oct 23 12:18:57 2020 rev:11 rq:842656 version:1.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-freezegun/python-freezegun.changes 2020-08-25 12:38:08.093407316 +0200 +++ /work/SRC/openSUSE:Factory/.python-freezegun.new.3463/python-freezegun.changes 2020-10-23 12:19:14.152555706 +0200 @@ -1,0 +2,11 @@ +Tue Oct 20 01:42:22 UTC 2020 - Steve Kowalik <steven.kowa...@suse.com> + +- Update to 1.0.0: + * Dropped Py2 support + * Added as_kwarg argument in order to have the frozen time object passed + with the name provided in as_kwarg argument +- Drop denose.patch +- Drop python-six from {Build,}Requires +- Update version of python-dateutil in {Build,}Requires + +------------------------------------------------------------------- Old: ---- denose.patch freezegun-0.3.15.tar.gz New: ---- freezegun-1.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-freezegun.spec ++++++ --- /var/tmp/diff_new_pack.M7e81m/_old 2020-10-23 12:19:14.992556140 +0200 +++ /var/tmp/diff_new_pack.M7e81m/_new 2020-10-23 12:19:14.996556142 +0200 @@ -19,24 +19,20 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %bcond_without python2 Name: python-freezegun -Version: 0.3.15 +Version: 1.0.0 Release: 0 Summary: Mock time date for Python License: Apache-2.0 URL: https://github.com/spulec/freezegun Source: https://files.pythonhosted.org/packages/source/f/freezegun/freezegun-%{version}.tar.gz -# gh#spulec/freezegun#259 -Patch1: denose.patch BuildRequires: %{python_module pytest} -BuildRequires: %{python_module python-dateutil > 2.0} +BuildRequires: %{python_module python-dateutil > 2.7} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module six} BuildRequires: %{pythons} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python -Requires: python-python-dateutil > 2.0 -Requires: python-six +Requires: python-python-dateutil > 2.7 BuildArch: noarch %if %{with python2} BuildRequires: python-mock ++++++ freezegun-0.3.15.tar.gz -> freezegun-1.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/AUTHORS.rst new/freezegun-1.0.0/AUTHORS.rst --- old/freezegun-0.3.15/AUTHORS.rst 2018-10-15 04:31:36.000000000 +0200 +++ new/freezegun-1.0.0/AUTHORS.rst 2020-09-05 02:51:58.000000000 +0200 @@ -15,3 +15,4 @@ - `Alex Ehlke <https://github.com/aehlke>`_ - `James Lu <github.com/CrazyPython>`_ - `Dan Elkis <github.com/rinslow>`_ +- `Bastien Vallet <github.com/djailla>`_ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/CHANGELOG new/freezegun-1.0.0/CHANGELOG --- old/freezegun-0.3.15/CHANGELOG 2020-02-18 01:24:32.000000000 +0100 +++ new/freezegun-1.0.0/CHANGELOG 2020-09-05 18:24:04.000000000 +0200 @@ -4,6 +4,12 @@ Latest ------ +1.0.0 +------ + +* Dropped Py2 support +* Added as_kwarg argument in order to have the frozen time object passed with the name provided in as_kwarg argument + 0.3.15 ------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/PKG-INFO new/freezegun-1.0.0/PKG-INFO --- old/freezegun-0.3.15/PKG-INFO 2020-02-18 01:25:22.000000000 +0100 +++ new/freezegun-1.0.0/PKG-INFO 2020-09-05 18:30:28.900934200 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: freezegun -Version: 0.3.15 +Version: 1.0.0 Summary: Let your Python tests travel through time Home-page: https://github.com/spulec/freezegun Author: Steve Pulec @@ -51,6 +51,23 @@ def test_the_class(self): assert datetime.datetime.now() == datetime.datetime(2012, 1, 14) + # Or method decorator, might also pass frozen time object as kwarg + + class TestUnitTestMethodDecorator(unittest.TestCase): + @freeze_time('2013-04-09') + def test_method_decorator_works_on_unittest(self): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + + @freeze_time('2013-04-09', as_kwarg='frozen_time') + def test_method_decorator_works_on_unittest(self, frozen_time): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today()) + + @freeze_time('2013-04-09', as_kwarg='hello') + def test_method_decorator_works_on_unittest(self, **kwargs): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today()) + Context manager ~~~~~~~~~~~~~~~ @@ -245,8 +262,6 @@ Platform: UNKNOWN Classifier: License :: OSI Approved :: Apache Software License -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 @@ -254,4 +269,4 @@ Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* +Requires-Python: >=3.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/README.rst new/freezegun-1.0.0/README.rst --- old/freezegun-0.3.15/README.rst 2019-07-09 04:03:36.000000000 +0200 +++ new/freezegun-1.0.0/README.rst 2020-09-05 02:51:58.000000000 +0200 @@ -43,6 +43,23 @@ def test_the_class(self): assert datetime.datetime.now() == datetime.datetime(2012, 1, 14) + # Or method decorator, might also pass frozen time object as kwarg + + class TestUnitTestMethodDecorator(unittest.TestCase): + @freeze_time('2013-04-09') + def test_method_decorator_works_on_unittest(self): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + + @freeze_time('2013-04-09', as_kwarg='frozen_time') + def test_method_decorator_works_on_unittest(self, frozen_time): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today()) + + @freeze_time('2013-04-09', as_kwarg='hello') + def test_method_decorator_works_on_unittest(self, **kwargs): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today()) + Context manager ~~~~~~~~~~~~~~~ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/freezegun/__init__.py new/freezegun-1.0.0/freezegun/__init__.py --- old/freezegun-0.3.15/freezegun/__init__.py 2020-02-18 01:24:45.000000000 +0100 +++ new/freezegun-1.0.0/freezegun/__init__.py 2020-09-05 18:24:31.000000000 +0200 @@ -9,7 +9,7 @@ from .api import freeze_time __title__ = 'freezegun' -__version__ = '0.3.15' +__version__ = '1.0.0' __author__ = 'Steve Pulec' __license__ = 'Apache License 2.0' __copyright__ = 'Copyright 2012 Steve Pulec' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/freezegun/_async.py new/freezegun-1.0.0/freezegun/_async.py --- old/freezegun-0.3.15/freezegun/_async.py 2020-01-14 03:31:03.000000000 +0100 +++ new/freezegun-1.0.0/freezegun/_async.py 2020-09-05 02:51:58.000000000 +0200 @@ -1,7 +1,5 @@ import functools -import asyncio - def wrap_coroutine(api, coroutine): @functools.wraps(coroutine) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/freezegun/api.py new/freezegun-1.0.0/freezegun/api.py --- old/freezegun-0.3.15/freezegun/api.py 2020-02-18 01:23:41.000000000 +0100 +++ new/freezegun-1.0.0/freezegun/api.py 2020-09-05 02:51:58.000000000 +0200 @@ -513,8 +513,7 @@ class _freeze_time(object): - - def __init__(self, time_to_freeze_str, tz_offset, ignore, tick, as_arg, auto_tick_seconds): + def __init__(self, time_to_freeze_str, tz_offset, ignore, tick, as_arg, as_kwarg, auto_tick_seconds): self.time_to_freeze = _parse_time_to_freeze(time_to_freeze_str) self.tz_offset = _parse_tz_offset(tz_offset) self.ignore = tuple(ignore) @@ -523,6 +522,7 @@ self.undo_changes = [] self.modules_at_start = set() self.as_arg = as_arg + self.as_kwarg = as_kwarg def __call__(self, func): if inspect.isclass(func): @@ -693,7 +693,7 @@ continue elif mod_name.startswith(self.ignore) or mod_name.endswith('.six.moves'): continue - elif (not hasattr(module, "__name__") or module.__name__ in ('datetime', 'time')): + elif not hasattr(module, "__name__") or module.__name__ in ('datetime', 'time'): continue for module_attribute in dir(module): @@ -729,8 +729,13 @@ def decorate_callable(self, func): def wrapper(*args, **kwargs): with self as time_factory: - if self.as_arg: + if self.as_arg and self.as_kwarg: + assert False, "You can't specify both as_arg and as_kwarg at the same time. Pick one." + elif self.as_arg: result = func(time_factory, *args, **kwargs) + elif self.as_kwarg: + kwargs[self.as_kwarg] = time_factory + result = func(*args, **kwargs) else: result = func(*args, **kwargs) return result @@ -743,7 +748,8 @@ return wrapper -def freeze_time(time_to_freeze=None, tz_offset=0, ignore=None, tick=False, as_arg=False, auto_tick_seconds=0): +def freeze_time(time_to_freeze=None, tz_offset=0, ignore=None, tick=False, as_arg=False, as_kwarg='', + auto_tick_seconds=0): acceptable_times = (type(None), _string_type, datetime.date, datetime.timedelta, types.FunctionType, types.GeneratorType) @@ -770,17 +776,19 @@ if ignore is None: ignore = [] ignore = ignore[:] - ignore.append('nose.plugins') - ignore.append('six.moves') - ignore.append('django.utils.six.moves') - ignore.append('google.gax') - ignore.append('threading') - ignore.append('Queue') - ignore.append('selenium') - ignore.append('_pytest.terminal.') - ignore.append('_pytest.runner.') + ignore.extend(['nose.plugins', + 'six.moves', + 'django.utils.six.moves', + 'google.gax', + 'threading', + 'Queue', + 'selenium', + '_pytest.terminal.', + '_pytest.runner.', + 'gi', + ]) - return _freeze_time(time_to_freeze, tz_offset, ignore, tick, as_arg, auto_tick_seconds) + return _freeze_time(time_to_freeze, tz_offset, ignore, tick, as_arg, as_kwarg, auto_tick_seconds) # Setup adapters for sqlite diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/freezegun.egg-info/PKG-INFO new/freezegun-1.0.0/freezegun.egg-info/PKG-INFO --- old/freezegun-0.3.15/freezegun.egg-info/PKG-INFO 2020-02-18 01:25:22.000000000 +0100 +++ new/freezegun-1.0.0/freezegun.egg-info/PKG-INFO 2020-09-05 18:30:28.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: freezegun -Version: 0.3.15 +Version: 1.0.0 Summary: Let your Python tests travel through time Home-page: https://github.com/spulec/freezegun Author: Steve Pulec @@ -51,6 +51,23 @@ def test_the_class(self): assert datetime.datetime.now() == datetime.datetime(2012, 1, 14) + # Or method decorator, might also pass frozen time object as kwarg + + class TestUnitTestMethodDecorator(unittest.TestCase): + @freeze_time('2013-04-09') + def test_method_decorator_works_on_unittest(self): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + + @freeze_time('2013-04-09', as_kwarg='frozen_time') + def test_method_decorator_works_on_unittest(self, frozen_time): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today()) + + @freeze_time('2013-04-09', as_kwarg='hello') + def test_method_decorator_works_on_unittest(self, **kwargs): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today()) + Context manager ~~~~~~~~~~~~~~~ @@ -245,8 +262,6 @@ Platform: UNKNOWN Classifier: License :: OSI Approved :: Apache Software License -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 @@ -254,4 +269,4 @@ Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* +Requires-Python: >=3.5 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/freezegun.egg-info/requires.txt new/freezegun-1.0.0/freezegun.egg-info/requires.txt --- old/freezegun-0.3.15/freezegun.egg-info/requires.txt 2020-02-18 01:25:22.000000000 +0100 +++ new/freezegun-1.0.0/freezegun.egg-info/requires.txt 2020-09-05 18:30:28.000000000 +0200 @@ -1,2 +1 @@ -six -python-dateutil!=2.0,>=1.0 +python-dateutil>=2.7 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/setup.py new/freezegun-1.0.0/setup.py --- old/freezegun-0.3.15/setup.py 2020-02-18 01:24:40.000000000 +0100 +++ new/freezegun-1.0.0/setup.py 2020-09-05 18:24:08.000000000 +0200 @@ -1,42 +1,25 @@ #!/usr/bin/env python -import sys from setuptools import setup -requires = ['six'] -tests_require = [ - 'mock;python_version<"3.4"', - 'nose' -] - -if sys.version_info.major == 2: - requires += ['python-dateutil>=1.0, != 2.0'] -else: - # Py3k - requires += ['python-dateutil>=2.0'] - - with open('README.rst') as f: readme = f.read() setup( name='freezegun', - version='0.3.15', + version='1.0.0', description='Let your Python tests travel through time', long_description=readme, author='Steve Pulec', author_email='spu...@gmail.com', url='https://github.com/spulec/freezegun', packages=['freezegun'], - install_requires=requires, - tests_require=tests_require, + install_requires=['python-dateutil>=2.7'], include_package_data=True, license='Apache 2.0', - python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*', + python_requires='>=3.5', classifiers=[ 'License :: OSI Approved :: Apache Software License', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/tests/fake_module.py new/freezegun-1.0.0/tests/fake_module.py --- old/freezegun-0.3.15/tests/fake_module.py 2018-03-06 01:33:10.000000000 +0100 +++ new/freezegun-1.0.0/tests/fake_module.py 2020-09-05 02:51:58.000000000 +0200 @@ -1,5 +1,4 @@ -from datetime import datetime -from datetime import date +from datetime import date, datetime from time import time, localtime, gmtime, strftime diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/tests/test_asyncio.py new/freezegun-1.0.0/tests/test_asyncio.py --- old/freezegun-0.3.15/tests/test_asyncio.py 2019-05-30 03:52:31.000000000 +0200 +++ new/freezegun-1.0.0/tests/test_asyncio.py 2020-09-05 02:51:58.000000000 +0200 @@ -1,22 +1,17 @@ +import asyncio import datetime from textwrap import dedent from unittest import SkipTest - from freezegun import freeze_time -try: - import asyncio -except ImportError: - asyncio = False - def test_time_freeze_coroutine(): if not asyncio: raise SkipTest('asyncio required') - @asyncio.coroutine + @freeze_time('1970-01-01') - def frozen_coroutine(): + async def frozen_coroutine(): assert datetime.date.today() == datetime.date(1970, 1, 1) asyncio.get_event_loop().run_until_complete(frozen_coroutine()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/tests/test_datetimes.py new/freezegun-1.0.0/tests/test_datetimes.py --- old/freezegun-0.3.15/tests/test_datetimes.py 2020-02-18 01:23:41.000000000 +0100 +++ new/freezegun-1.0.0/tests/test_datetimes.py 2020-09-05 02:51:58.000000000 +0200 @@ -15,7 +15,6 @@ try: import maya - except ImportError: maya = None @@ -261,9 +260,10 @@ def test_real_strftime_fall_through(): - with freeze_time(ignore=['_pytest']): - time.strftime('%Y') - time.strftime('%Y', (2001, 1, 1, 1, 1, 1, 1, 1, 1)) == '2001' + this_real_year = datetime.datetime.now().year + with freeze_time(): + assert time.strftime('%Y') == str(this_real_year) + assert time.strftime('%Y', (2001, 1, 1, 1, 1, 1, 1, 1, 1)) == '2001' def test_date_object(): @@ -484,6 +484,22 @@ assert isinstance(today, datetime.date) +class TestUnitTestMethodDecorator(unittest.TestCase): + @freeze_time('2013-04-09') + def test_method_decorator_works_on_unittest(self): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + + @freeze_time('2013-04-09', as_kwarg='frozen_time') + def test_method_decorator_works_on_unittest_kwarg_frozen_time(self, frozen_time): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), frozen_time.time_to_freeze.today()) + + @freeze_time('2013-04-09', as_kwarg='hello') + def test_method_decorator_works_on_unittest_kwarg_hello(self, **kwargs): + self.assertEqual(datetime.date(2013, 4, 9), datetime.date.today()) + self.assertEqual(datetime.date(2013, 4, 9), kwargs.get('hello').time_to_freeze.today()) + + @freeze_time('2013-04-09') class TestUnitTestClassDecorator(unittest.TestCase): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/tests/test_ticking.py new/freezegun-1.0.0/tests/test_ticking.py --- old/freezegun-0.3.15/tests/test_ticking.py 2020-01-14 03:31:03.000000000 +0100 +++ new/freezegun-1.0.0/tests/test_ticking.py 2020-09-05 02:51:58.000000000 +0200 @@ -1,9 +1,7 @@ import datetime import time -try: - from unittest import mock -except (ImportError, AttributeError): - import mock + +from unittest import mock import pytest from freezegun import freeze_time diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/tests/test_utils.py new/freezegun-1.0.0/tests/test_utils.py --- old/freezegun-0.3.15/tests/test_utils.py 2020-01-14 03:31:03.000000000 +0100 +++ new/freezegun-1.0.0/tests/test_utils.py 2020-09-05 02:51:58.000000000 +0200 @@ -1,9 +1,4 @@ -from unittest import SkipTest - -try: - from unittest import mock -except (ImportError, AttributeError): - import mock +from unittest import SkipTest, mock from freezegun import api from tests import utils diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/freezegun-0.3.15/tests/test_uuid.py new/freezegun-1.0.0/tests/test_uuid.py --- old/freezegun-0.3.15/tests/test_uuid.py 2019-05-30 03:52:31.000000000 +0200 +++ new/freezegun-1.0.0/tests/test_uuid.py 2020-09-05 02:51:58.000000000 +0200 @@ -1,4 +1,3 @@ -from __future__ import print_function, absolute_import, unicode_literals import datetime import uuid