Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-DateTime for openSUSE:Factory checked in at 2023-01-14 00:03:10 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-DateTime (Old) and /work/SRC/openSUSE:Factory/.python-DateTime.new.32243 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-DateTime" Sat Jan 14 00:03:10 2023 rev:6 rq:1058185 version:5.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-DateTime/python-DateTime.changes 2023-01-04 20:18:30.133596680 +0100 +++ /work/SRC/openSUSE:Factory/.python-DateTime.new.32243/python-DateTime.changes 2023-01-14 00:04:00.677988239 +0100 @@ -1,0 +2,6 @@ +Fri Jan 13 09:40:13 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 5.0: + * Drop support for Python 2.7, 3.5, 3.6. + +------------------------------------------------------------------- Old: ---- DateTime-4.9.tar.gz New: ---- DateTime-5.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-DateTime.spec ++++++ --- /var/tmp/diff_new_pack.kIb9gs/_old 2023-01-14 00:04:01.225991431 +0100 +++ /var/tmp/diff_new_pack.kIb9gs/_new 2023-01-14 00:04:01.229991455 +0100 @@ -18,13 +18,14 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-DateTime -Version: 4.9 +Version: 5.0 Release: 0 Summary: Zope DateTime data type License: ZPL-2.1 Group: Development/Languages/Python URL: https://github.com/zopefoundation/DateTime Source: https://files.pythonhosted.org/packages/source/D/DateTime/DateTime-%{version}.tar.gz +BuildRequires: %{python_module base >= 3.7} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros ++++++ DateTime-4.9.tar.gz -> DateTime-5.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/CHANGES.rst new/DateTime-5.0/CHANGES.rst --- old/DateTime-4.9/CHANGES.rst 2022-12-22 08:11:05.000000000 +0100 +++ new/DateTime-5.0/CHANGES.rst 2023-01-12 15:04:56.000000000 +0100 @@ -1,11 +1,10 @@ Changelog ========= -4.9 (2022-12-22) +5.0 (2023-01-12) ---------------- -- Fix regression in 4.7 on Python 2 when calling ``asdatetime``. - (`#47 <https://github.com/zopefoundation/DateTime/issues/47>`_) +- Drop support for Python 2.7, 3.5, 3.6. 4.8 (2022-12-16) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/MANIFEST.in new/DateTime-5.0/MANIFEST.in --- old/DateTime-4.9/MANIFEST.in 2022-12-22 08:10:24.000000000 +0100 +++ new/DateTime-5.0/MANIFEST.in 2023-01-11 17:50:53.000000000 +0100 @@ -7,5 +7,4 @@ include tox.ini recursive-include src *.py -include buildout4.cfg recursive-include src *.txt diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/PKG-INFO new/DateTime-5.0/PKG-INFO --- old/DateTime-4.9/PKG-INFO 2022-12-22 08:16:04.702712300 +0100 +++ new/DateTime-5.0/PKG-INFO 2023-01-12 15:09:30.361405600 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: DateTime -Version: 4.9 +Version: 5.0 Summary: This package provides a DateTime data type, as known from Zope. Unless you need to communicate with Zope APIs, you're probably better off using Python's built-in datetime module. Home-page: https://github.com/zopefoundation/DateTime Author: Zope Foundation and Contributors @@ -12,11 +12,7 @@ Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -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 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 @@ -842,11 +838,10 @@ Changelog ========= -4.9 (2022-12-22) +5.0 (2023-01-12) ---------------- -- Fix regression in 4.7 on Python 2 when calling ``asdatetime``. - (`#47 <https://github.com/zopefoundation/DateTime/issues/47>`_) +- Drop support for Python 2.7, 3.5, 3.6. 4.8 (2022-12-16) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/buildout.cfg new/DateTime-5.0/buildout.cfg --- old/DateTime-4.9/buildout.cfg 2022-06-27 14:36:59.000000000 +0200 +++ new/DateTime-5.0/buildout.cfg 2023-01-11 17:50:27.000000000 +0100 @@ -2,7 +2,9 @@ extends = https://zopefoundation.github.io/Zope/releases/master/versions.cfg develop = . -parts = interpreter test +parts = + interpreter + test [versions] DateTime = @@ -12,7 +14,6 @@ interpreter = py eggs = DateTime - tox [test] recipe = zc.recipe.testrunner diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/buildout4.cfg new/DateTime-5.0/buildout4.cfg --- old/DateTime-4.9/buildout4.cfg 2022-12-22 08:10:24.000000000 +0100 +++ new/DateTime-5.0/buildout4.cfg 1970-01-01 01:00:00.000000000 +0100 @@ -1,7 +0,0 @@ -[buildout] -extends = - buildout.cfg - http://zopefoundation.github.io/Zope/releases/4.x/versions.cfg - -[versions] -DateTime = diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/setup.cfg new/DateTime-5.0/setup.cfg --- old/DateTime-4.9/setup.cfg 2022-12-22 08:16:04.702992400 +0100 +++ new/DateTime-5.0/setup.cfg 2023-01-12 15:09:30.361647000 +0100 @@ -1,5 +1,5 @@ [bdist_wheel] -universal = 1 +universal = 0 [flake8] doctests = 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/setup.py new/DateTime-5.0/setup.py --- old/DateTime-4.9/setup.py 2022-12-22 08:11:12.000000000 +0100 +++ new/DateTime-5.0/setup.py 2023-01-12 15:05:02.000000000 +0100 @@ -26,7 +26,7 @@ with open(os.path.join(here, 'CHANGES.rst')) as f: CHANGES = f.read() -version = '4.9' +version = '5.0' setup( name='DateTime', @@ -54,11 +54,7 @@ "License :: OSI Approved :: Zope Public License", "Operating System :: OS Independent", "Programming Language :: Python", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/src/DateTime/DateTime.py new/DateTime-5.0/src/DateTime/DateTime.py --- old/DateTime-4.9/src/DateTime/DateTime.py 2022-12-22 08:10:24.000000000 +0100 +++ new/DateTime-5.0/src/DateTime/DateTime.py 2022-12-23 11:56:59.000000000 +0100 @@ -11,9 +11,9 @@ # ############################################################################## +import copyreg as copy_reg import math import re -import sys from datetime import datetime from time import altzone from time import daylight @@ -33,14 +33,9 @@ from .pytz_support import PytzCache -if sys.version_info > (3, ): # pragma: PY3 - import copyreg as copy_reg - basestring = str - long = int - explicit_unicode_type = type(None) -else: # pragma: PY2 - import copy_reg - explicit_unicode_type = unicode # noqa: F821 undefined name +basestring = str +long = int +explicit_unicode_type = type(None) default_datefmt = None @@ -366,7 +361,7 @@ return sorted(list(PytzCache._zmap.values())) -class strftimeFormatter(object): +class strftimeFormatter: def __init__(self, dt, format): self.dt = dt @@ -377,7 +372,7 @@ @implementer(IDateTime) -class DateTime(object): +class DateTime: """DateTime objects represent instants in time and provide interfaces for controlling its representation without affecting the absolute value of the object. @@ -448,7 +443,7 @@ except (DateError, TimeError, DateTimeError): raise except Exception: - raise SyntaxError('Unable to parse %s, %s' % (args, kw)) + raise SyntaxError('Unable to parse {}, {}'.format(args, kw)) def __getstate__(self): # We store a float of _micros, instead of the _micros long, as we most @@ -680,8 +675,6 @@ # flag indicating whether this was constructed in a timezone naive # manner yr, mo, dy, hr, mn, sc, tz, t, d, s, microsecs, tznaive = args - if isinstance(microsecs, float): - microsecs = long(round(microsecs)) if tznaive is not None: # preserve this information self._timezone_naive = tznaive @@ -821,7 +814,7 @@ hr, mn, sc, tz = 0, 0, 0, 0 yr = _correctYear(yr) if not self._validDate(yr, mo, dy): - raise DateError('Invalid date: %s' % (args, )) + raise DateError('Invalid date: {}'.format(args)) args = args[3:] if args: hr, args = args[0], args[1:] @@ -966,7 +959,7 @@ i = i + ls if (ls == 4 and d and d in '+-' and (len(ints) + (not not month) >= 3)): - tz = '%s%s' % (d, s) + tz = '{}{}'.format(d, s) else: v = int(s) ints.append(v) @@ -1780,7 +1773,7 @@ """Convert a DateTime to a string that looks like a Python expression. """ - return '%s(\'%s\')' % (self.__class__.__name__, str(self)) + return '{}(\'{}\')'.format(self.__class__.__name__, str(self)) def __str__(self): """Convert a DateTime to a string.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/src/DateTime/pytz_support.py new/DateTime-5.0/src/DateTime/pytz_support.py --- old/DateTime-4.9/src/DateTime/pytz_support.py 2022-12-22 08:10:24.000000000 +0100 +++ new/DateTime-5.0/src/DateTime/pytz_support.py 2022-12-23 11:56:59.000000000 +0100 @@ -25,50 +25,50 @@ EPOCH = datetime.utcfromtimestamp(0).replace(tzinfo=pytz.utc) _numeric_timezone_data = { - 'GMT': ('GMT', 0, 1, [], '', [(0, 0, 0)], 'GMT\000'), - 'GMT+0': ('GMT+0', 0, 1, [], '', [(0, 0, 0)], 'GMT+0000\000'), - 'GMT+1': ('GMT+1', 0, 1, [], '', [(3600, 0, 0)], 'GMT+0100\000'), - 'GMT+2': ('GMT+2', 0, 1, [], '', [(7200, 0, 0)], 'GMT+0200\000'), - 'GMT+3': ('GMT+3', 0, 1, [], '', [(10800, 0, 0)], 'GMT+0300\000'), - 'GMT+4': ('GMT+4', 0, 1, [], '', [(14400, 0, 0)], 'GMT+0400\000'), - 'GMT+5': ('GMT+5', 0, 1, [], '', [(18000, 0, 0)], 'GMT+0500\000'), - 'GMT+6': ('GMT+6', 0, 1, [], '', [(21600, 0, 0)], 'GMT+0600\000'), - 'GMT+7': ('GMT+7', 0, 1, [], '', [(25200, 0, 0)], 'GMT+0700\000'), - 'GMT+8': ('GMT+8', 0, 1, [], '', [(28800, 0, 0)], 'GMT+0800\000'), - 'GMT+9': ('GMT+9', 0, 1, [], '', [(32400, 0, 0)], 'GMT+0900\000'), - 'GMT+10': ('GMT+10', 0, 1, [], '', [(36000, 0, 0)], 'GMT+1000\000'), - 'GMT+11': ('GMT+11', 0, 1, [], '', [(39600, 0, 0)], 'GMT+1100\000'), - 'GMT+12': ('GMT+12', 0, 1, [], '', [(43200, 0, 0)], 'GMT+1200\000'), - 'GMT+13': ('GMT+13', 0, 1, [], '', [(46800, 0, 0)], 'GMT+1300\000'), - - 'GMT-1': ('GMT-1', 0, 1, [], '', [(-3600, 0, 0)], 'GMT-0100\000'), - 'GMT-2': ('GMT-2', 0, 1, [], '', [(-7200, 0, 0)], 'GMT-0200\000'), - 'GMT-3': ('GMT-3', 0, 1, [], '', [(-10800, 0, 0)], 'GMT-0300\000'), - 'GMT-4': ('GMT-4', 0, 1, [], '', [(-14400, 0, 0)], 'GMT-0400\000'), - 'GMT-5': ('GMT-5', 0, 1, [], '', [(-18000, 0, 0)], 'GMT-0500\000'), - 'GMT-6': ('GMT-6', 0, 1, [], '', [(-21600, 0, 0)], 'GMT-0600\000'), - 'GMT-7': ('GMT-7', 0, 1, [], '', [(-25200, 0, 0)], 'GMT-0700\000'), - 'GMT-8': ('GMT-8', 0, 1, [], '', [(-28800, 0, 0)], 'GMT-0800\000'), - 'GMT-9': ('GMT-9', 0, 1, [], '', [(-32400, 0, 0)], 'GMT-0900\000'), - 'GMT-10': ('GMT-10', 0, 1, [], '', [(-36000, 0, 0)], 'GMT-1000\000'), - 'GMT-11': ('GMT-11', 0, 1, [], '', [(-39600, 0, 0)], 'GMT-1100\000'), - 'GMT-12': ('GMT-12', 0, 1, [], '', [(-43200, 0, 0)], 'GMT-1200\000'), - - 'GMT+0130': ('GMT+0130', 0, 1, [], '', [(5400, 0, 0)], 'GMT+0130\000'), - 'GMT+0230': ('GMT+0230', 0, 1, [], '', [(9000, 0, 0)], 'GMT+0230\000'), - 'GMT+0330': ('GMT+0330', 0, 1, [], '', [(12600, 0, 0)], 'GMT+0330\000'), - 'GMT+0430': ('GMT+0430', 0, 1, [], '', [(16200, 0, 0)], 'GMT+0430\000'), - 'GMT+0530': ('GMT+0530', 0, 1, [], '', [(19800, 0, 0)], 'GMT+0530\000'), - 'GMT+0630': ('GMT+0630', 0, 1, [], '', [(23400, 0, 0)], 'GMT+0630\000'), - 'GMT+0730': ('GMT+0730', 0, 1, [], '', [(27000, 0, 0)], 'GMT+0730\000'), - 'GMT+0830': ('GMT+0830', 0, 1, [], '', [(30600, 0, 0)], 'GMT+0830\000'), - 'GMT+0930': ('GMT+0930', 0, 1, [], '', [(34200, 0, 0)], 'GMT+0930\000'), - 'GMT+1030': ('GMT+1030', 0, 1, [], '', [(37800, 0, 0)], 'GMT+1030\000'), - 'GMT+1130': ('GMT+1130', 0, 1, [], '', [(41400, 0, 0)], 'GMT+1130\000'), - 'GMT+1230': ('GMT+1230', 0, 1, [], '', [(45000, 0, 0)], 'GMT+1230\000'), + 'GMT': ('GMT', 0, 1, [], '', [(0, 0, 0)], 'GMT\000'), + 'GMT+0': ('GMT+0', 0, 1, [], '', [(0, 0, 0)], 'GMT+0000\000'), + 'GMT+1': ('GMT+1', 0, 1, [], '', [(3600, 0, 0)], 'GMT+0100\000'), + 'GMT+2': ('GMT+2', 0, 1, [], '', [(7200, 0, 0)], 'GMT+0200\000'), + 'GMT+3': ('GMT+3', 0, 1, [], '', [(10800, 0, 0)], 'GMT+0300\000'), + 'GMT+4': ('GMT+4', 0, 1, [], '', [(14400, 0, 0)], 'GMT+0400\000'), + 'GMT+5': ('GMT+5', 0, 1, [], '', [(18000, 0, 0)], 'GMT+0500\000'), + 'GMT+6': ('GMT+6', 0, 1, [], '', [(21600, 0, 0)], 'GMT+0600\000'), + 'GMT+7': ('GMT+7', 0, 1, [], '', [(25200, 0, 0)], 'GMT+0700\000'), + 'GMT+8': ('GMT+8', 0, 1, [], '', [(28800, 0, 0)], 'GMT+0800\000'), + 'GMT+9': ('GMT+9', 0, 1, [], '', [(32400, 0, 0)], 'GMT+0900\000'), + 'GMT+10': ('GMT+10', 0, 1, [], '', [(36000, 0, 0)], 'GMT+1000\000'), + 'GMT+11': ('GMT+11', 0, 1, [], '', [(39600, 0, 0)], 'GMT+1100\000'), + 'GMT+12': ('GMT+12', 0, 1, [], '', [(43200, 0, 0)], 'GMT+1200\000'), + 'GMT+13': ('GMT+13', 0, 1, [], '', [(46800, 0, 0)], 'GMT+1300\000'), + + 'GMT-1': ('GMT-1', 0, 1, [], '', [(-3600, 0, 0)], 'GMT-0100\000'), + 'GMT-2': ('GMT-2', 0, 1, [], '', [(-7200, 0, 0)], 'GMT-0200\000'), + 'GMT-3': ('GMT-3', 0, 1, [], '', [(-10800, 0, 0)], 'GMT-0300\000'), + 'GMT-4': ('GMT-4', 0, 1, [], '', [(-14400, 0, 0)], 'GMT-0400\000'), + 'GMT-5': ('GMT-5', 0, 1, [], '', [(-18000, 0, 0)], 'GMT-0500\000'), + 'GMT-6': ('GMT-6', 0, 1, [], '', [(-21600, 0, 0)], 'GMT-0600\000'), + 'GMT-7': ('GMT-7', 0, 1, [], '', [(-25200, 0, 0)], 'GMT-0700\000'), + 'GMT-8': ('GMT-8', 0, 1, [], '', [(-28800, 0, 0)], 'GMT-0800\000'), + 'GMT-9': ('GMT-9', 0, 1, [], '', [(-32400, 0, 0)], 'GMT-0900\000'), + 'GMT-10': ('GMT-10', 0, 1, [], '', [(-36000, 0, 0)], 'GMT-1000\000'), + 'GMT-11': ('GMT-11', 0, 1, [], '', [(-39600, 0, 0)], 'GMT-1100\000'), + 'GMT-12': ('GMT-12', 0, 1, [], '', [(-43200, 0, 0)], 'GMT-1200\000'), + + 'GMT+0130': ('GMT+0130', 0, 1, [], '', [(5400, 0, 0)], 'GMT+0130\000'), + 'GMT+0230': ('GMT+0230', 0, 1, [], '', [(9000, 0, 0)], 'GMT+0230\000'), + 'GMT+0330': ('GMT+0330', 0, 1, [], '', [(12600, 0, 0)], 'GMT+0330\000'), + 'GMT+0430': ('GMT+0430', 0, 1, [], '', [(16200, 0, 0)], 'GMT+0430\000'), + 'GMT+0530': ('GMT+0530', 0, 1, [], '', [(19800, 0, 0)], 'GMT+0530\000'), + 'GMT+0630': ('GMT+0630', 0, 1, [], '', [(23400, 0, 0)], 'GMT+0630\000'), + 'GMT+0730': ('GMT+0730', 0, 1, [], '', [(27000, 0, 0)], 'GMT+0730\000'), + 'GMT+0830': ('GMT+0830', 0, 1, [], '', [(30600, 0, 0)], 'GMT+0830\000'), + 'GMT+0930': ('GMT+0930', 0, 1, [], '', [(34200, 0, 0)], 'GMT+0930\000'), + 'GMT+1030': ('GMT+1030', 0, 1, [], '', [(37800, 0, 0)], 'GMT+1030\000'), + 'GMT+1130': ('GMT+1130', 0, 1, [], '', [(41400, 0, 0)], 'GMT+1130\000'), + 'GMT+1230': ('GMT+1230', 0, 1, [], '', [(45000, 0, 0)], 'GMT+1230\000'), - 'GMT-0130': ('GMT-0130', 0, 1, [], '', [(-5400, 0, 0)], 'GMT-0130\000'), - 'GMT-0230': ('GMT-0230', 0, 1, [], '', [(-9000, 0, 0)], 'GMT-0230\000'), + 'GMT-0130': ('GMT-0130', 0, 1, [], '', [(-5400, 0, 0)], 'GMT-0130\000'), + 'GMT-0230': ('GMT-0230', 0, 1, [], '', [(-9000, 0, 0)], 'GMT-0230\000'), 'GMT-0330': ('GMT-0330', 0, 1, [], '', [(-12600, 0, 0)], 'GMT-0330\000'), 'GMT-0430': ('GMT-0430', 0, 1, [], '', [(-16200, 0, 0)], 'GMT-0430\000'), 'GMT-0530': ('GMT-0530', 0, 1, [], '', [(-19800, 0, 0)], 'GMT-0530\000'), @@ -208,8 +208,8 @@ return cls() -_numeric_timezones = dict((key, _static_timezone_factory(data)) - for key, data in _numeric_timezone_data.items()) +_numeric_timezones = {key: _static_timezone_factory(data) + for key, data in _numeric_timezone_data.items()} class Timezone: @@ -249,7 +249,7 @@ """ _zlst = pytz.common_timezones + _old_zlst # used by DateTime.TimeZones - _zmap = dict((name.lower(), name) for name in pytz.all_timezones) + _zmap = {name.lower(): name for name in pytz.all_timezones} _zmap.update(_old_zmap) # These must take priority _zidx = _zmap.keys() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/src/DateTime/tests/test_datetime.py new/DateTime-5.0/src/DateTime/tests/test_datetime.py --- old/DateTime-4.9/src/DateTime/tests/test_datetime.py 2022-12-22 08:10:24.000000000 +0100 +++ new/DateTime-5.0/src/DateTime/tests/test_datetime.py 2022-12-23 11:56:59.000000000 +0100 @@ -14,6 +14,7 @@ import math import os +import pickle import platform import sys import time @@ -29,14 +30,6 @@ from DateTime.DateTime import _findLocalTimeZoneName -if sys.version_info > (3, ): # pragma: PY3 - import pickle - unicode = str - PY3K = True -else: # pragma: PY2 - import cPickle as pickle - PY3K = False - try: __file__ except NameError: # pragma: no cover @@ -101,17 +94,13 @@ def testAddPrecision(self): # Precision of serial additions dt = DateTime() - calculated_dt = dt + 0.10 + 3.14 + 6.76 - 10 - self.assertEqual(str(calculated_dt), str(dt), dt) + self.assertEqual(str(dt + 0.10 + 3.14 + 6.76 - 10), str(dt), + dt) # checks problem reported in # https://github.com/zopefoundation/DateTime/issues/41 dt = DateTime(2038, 10, 7, 8, 52, 44.959840, "UTC") - calculated_dt = dt + 0.10 + 3.14 + 6.76 - 10 - self.assertEqual(str(calculated_dt), str(dt), dt) - # checks regression on Py 2.7 where asdatetime gave an error - py_dt = dt.asdatetime() - py_calculated_dt = calculated_dt.asdatetime() - self.assertEqual(py_dt, py_calculated_dt) + self.assertEqual(str(dt + 0.10 + 3.14 + 6.76 - 10), str(dt), + dt) def testConsistentSecondMicroRounding(self): dt = DateTime(2038, 10, 7, 8, 52, 44.9598398, "UTC") @@ -145,7 +134,7 @@ dt = DateTime() dt1 = DateTime(float(dt), dt.timezone()) self.assertEqual(str(dt), str(dt1), (dt, dt1)) - dt1 = DateTime(float(dt), unicode(dt.timezone())) + dt1 = DateTime(float(dt), str(dt.timezone())) self.assertEqual(str(dt), str(dt1), (dt, dt1)) def testConstructor6(self): @@ -285,8 +274,7 @@ '\x1bM\xd2\x07U\x08_nearsecq\x1cG\x00\x00\x00\x00\x00\x00\x00' '\x00U\x07_pmhourq\x1dK\x08U\n_dayoffsetq\x1eK\x04U\x04timeq' '\x1fG?\xd5UUUV\x00\x00ub.') - if PY3K: - data = data.encode('latin-1') + data = data.encode('latin-1') new = pickle.loads(data) for key in DateTime.__slots__: self.assertEqual(getattr(dt, key), getattr(new, key)) @@ -305,8 +293,7 @@ '\x04_dayq\x19K\x02U\x05_yearq\x1aM\xd2\x07U\x08_nearsecq' '\x1bG\x00\x00\x00\x00\x00\x00\x00\x00U\x07_pmhourq\x1cK\x08U' '\n_dayoffsetq\x1dK\x04U\x04timeq\x1eG?\xd5UUUV\x00\x00ub.') - if PY3K: - data = data.encode('latin-1') + data = data.encode('latin-1') new = pickle.loads(data) for key in DateTime.__slots__: self.assertEqual(getattr(dt, key), getattr(new, key)) @@ -481,7 +468,7 @@ def testJulianWeek(self): # Check JulianDayWeek function fn = os.path.join(DATADIR, 'julian_testdata.txt') - with open(fn, 'r') as fd: + with open(fn) as fd: lines = fd.readlines() for line in lines: d = DateTime(line[:10]) @@ -603,7 +590,7 @@ "Using Non-Ascii characters for strftime doesn't work in PyPy" "https://bitbucket.org/pypy/pypy/issues/2161/pypy3-strftime-does-not-accept-unicode" # noqa: E501 line too long ) - def testStrftimeUnicode(self): + def testStrftimeStr(self): dt = DateTime('2002-05-02T08:00:00+00:00') uchar = b'\xc3\xa0'.decode('utf-8') ok = dt.strftime('Le %d/%m/%Y a %Hh%M').replace('a', uchar) @@ -697,25 +684,23 @@ self.assertEqual(dt.__roles__, None) self.assertEqual(dt.__allow_access_to_unprotected_subobjects__, 1) - @unittest.skipUnless(PY3K, 'format method is Python 3 only') def test_format(self): dt = DateTime(1968, 3, 10, 23, 45, 0, 'Europe/Vienna') fmt = '%d.%m.%Y %H:%M' result = dt.strftime(fmt) unformatted_result = '1968/03/10 23:45:00 Europe/Vienna' - self.assertEqual(result, '{:%d.%m.%Y %H:%M}'.format(dt)) - self.assertEqual(unformatted_result, '{:}'.format(dt)) - self.assertEqual(unformatted_result, '{}'.format(dt)) - if sys.version_info >= (3, 6): # f-strings are new in Python 3.6 PY3 - eval("self.assertEqual(result, f'{dt:{fmt}}')") - eval("self.assertEqual(unformatted_result ,f'{dt:}')") - eval("self.assertEqual(unformatted_result, f'{dt}')") + self.assertEqual(result, f'{dt:%d.%m.%Y %H:%M}') + self.assertEqual(unformatted_result, f'{dt}') + self.assertEqual(unformatted_result, f'{dt}') + self.assertEqual(result, f'{dt:{fmt}}') + self.assertEqual(unformatted_result, f'{dt:}') + self.assertEqual(unformatted_result, f'{dt}') def test_suite(): import doctest return unittest.TestSuite([ - unittest.makeSuite(DateTimeTests), + unittest.defaultTestLoader.loadTestsFromTestCase(DateTimeTests), doctest.DocFileSuite('DateTime.txt', package='DateTime'), doctest.DocFileSuite('pytz.txt', package='DateTime'), ]) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/src/DateTime.egg-info/PKG-INFO new/DateTime-5.0/src/DateTime.egg-info/PKG-INFO --- old/DateTime-4.9/src/DateTime.egg-info/PKG-INFO 2022-12-22 08:16:04.000000000 +0100 +++ new/DateTime-5.0/src/DateTime.egg-info/PKG-INFO 2023-01-12 15:09:30.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: DateTime -Version: 4.9 +Version: 5.0 Summary: This package provides a DateTime data type, as known from Zope. Unless you need to communicate with Zope APIs, you're probably better off using Python's built-in datetime module. Home-page: https://github.com/zopefoundation/DateTime Author: Zope Foundation and Contributors @@ -12,11 +12,7 @@ Classifier: License :: OSI Approved :: Zope Public License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python -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 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 @@ -842,11 +838,10 @@ Changelog ========= -4.9 (2022-12-22) +5.0 (2023-01-12) ---------------- -- Fix regression in 4.7 on Python 2 when calling ``asdatetime``. - (`#47 <https://github.com/zopefoundation/DateTime/issues/47>`_) +- Drop support for Python 2.7, 3.5, 3.6. 4.8 (2022-12-16) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/src/DateTime.egg-info/SOURCES.txt new/DateTime-5.0/src/DateTime.egg-info/SOURCES.txt --- old/DateTime-4.9/src/DateTime.egg-info/SOURCES.txt 2022-12-22 08:16:04.000000000 +0100 +++ new/DateTime-5.0/src/DateTime.egg-info/SOURCES.txt 2023-01-12 15:09:30.000000000 +0100 @@ -5,7 +5,6 @@ MANIFEST.in README.rst buildout.cfg -buildout4.cfg setup.cfg setup.py tox.ini diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/DateTime-4.9/tox.ini new/DateTime-5.0/tox.ini --- old/DateTime-4.9/tox.ini 2022-12-22 08:10:24.000000000 +0100 +++ new/DateTime-5.0/tox.ini 2023-01-11 17:50:53.000000000 +0100 @@ -4,15 +4,11 @@ minversion = 3.18 envlist = lint - py27 - py35 - py36 py37 py38 py39 py310 py311 - pypy pypy3 coverage @@ -22,8 +18,7 @@ zc.buildout >= 3.0.1 wheel > 0.37 commands_pre = - py27,py35: {envbindir}/buildout -nc {toxinidir}/buildout4.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test - !py27-!py35: {envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test + {envbindir}/buildout -nc {toxinidir}/buildout.cfg buildout:directory={envdir} buildout:develop={toxinidir} install test commands = {envdir}/bin/test {posargs:-cv} @@ -35,7 +30,6 @@ mkdir commands = isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py - - flake8 {toxinidir}/src {toxinidir}/setup.py flake8 {toxinidir}/src {toxinidir}/setup.py check-manifest check-python-versions @@ -65,7 +59,6 @@ deps = {[testenv]deps} coverage - coverage-python-version commands = mkdir -p {toxinidir}/parts/htmlcov coverage run {envdir}/bin/test {posargs:-cv} @@ -74,7 +67,6 @@ [coverage:run] branch = True -plugins = coverage_python_version source = DateTime [coverage:report]