Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-dateparser for openSUSE:Factory checked in at 2023-01-04 17:50:46 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-dateparser (Old) and /work/SRC/openSUSE:Factory/.python-dateparser.new.1563 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-dateparser" Wed Jan 4 17:50:46 2023 rev:12 rq:1046277 version:1.1.5 Changes: -------- --- /work/SRC/openSUSE:Factory/python-dateparser/python-dateparser.changes 2022-11-09 12:56:31.888042145 +0100 +++ /work/SRC/openSUSE:Factory/.python-dateparser.new.1563/python-dateparser.changes 2023-01-04 17:50:55.961591009 +0100 @@ -1,0 +2,19 @@ +Mon Jan 2 18:57:33 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 1.1.5: + * Parse short versions of day, month, and year + * Add a test for âin 1dâ + * Update languages_info + * Add a workaround for zipimporter not having exec_module before Python + 3.10 + * Stabilize tests at midnight + * Add a test case for French + * Improved support for languages such as Slovak, Indonesian, Hindi, German + and Japanese + * Recursively create a model home + * Replace regex sub with simple string replace + * Add Python 3.10, 3.11 support + * Drop support for Python 3.5, 3.6 versions +- drop incompatible-regex-pattern.patch (upstream) + +------------------------------------------------------------------- Old: ---- dateparser-1.1.3.tar.gz incompatible-regex-pattern.patch New: ---- dateparser-1.1.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-dateparser.spec ++++++ --- /var/tmp/diff_new_pack.DBLq9C/_old 2023-01-04 17:50:56.609594828 +0100 +++ /var/tmp/diff_new_pack.DBLq9C/_new 2023-01-04 17:50:56.617594875 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-dateparser # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,15 +19,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-dateparser -Version: 1.1.3 +Version: 1.1.5 Release: 0 Summary: Date parsing library designed to parse dates from HTML pages License: BSD-3-Clause URL: https://github.com/scrapinghub/dateparser Source: https://files.pythonhosted.org/packages/source/d/dateparser/dateparser-%{version}.tar.gz -# PATCH-FIX-UPSTREAM incompatible-regex-pattern.patch gh#scrapinghub/dateparser#1052 mc...@suse.com -# use pattern compatible with the modern version of regex -Patch0: incompatible-regex-pattern.patch # PATCH-FIX-UPSTREAM mark-network-tests.patch gh#scrapinghub/dateparser#1059 mc...@suse.com # mark test requiring network access Patch1: mark-network-tests.patch ++++++ dateparser-1.1.3.tar.gz -> dateparser-1.1.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/HISTORY.rst new/dateparser-1.1.5/HISTORY.rst --- old/dateparser-1.1.3/HISTORY.rst 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/HISTORY.rst 2022-12-29 14:49:35.000000000 +0100 @@ -3,6 +3,35 @@ History ======= +1.1.5 (2022-12-29) +------------------ + +Improvements: + +- Parse short versions of day, month, and year (#1103) +- Add a test for âin 1dâ (#1104) +- Update languages_info (#1107) +- Add a workaround for zipimporter not having exec_module before Python 3.10 (#1069) +- Stabilize tests at midnight (#1111) +- Add a test case for French (#1110) + +Cleanups: + +- Remove the requirements-build file (#1113) + + +1.1.4 (2022-11-21) +------------------ + +Improvements: + +- Improved support for languages such as Slovak, Indonesian, Hindi, German and Japanese (#1064, #1094, #986, #1071, #1068) +- Recursively create a model home (#996) +- Replace regex sub with simple string replace (#1095) +- Add Python 3.10, 3.11 support (#1096) +- Drop support for Python 3.5, 3.6 versions (#1097) + + 1.1.3 (2022-11-03) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/MANIFEST.in new/dateparser-1.1.5/MANIFEST.in --- old/dateparser-1.1.3/MANIFEST.in 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/MANIFEST.in 2022-12-29 14:49:35.000000000 +0100 @@ -5,7 +5,6 @@ include README.rst include dateparser_data/settings.py include requirements.txt -include requirements-build.txt recursive-include tests * recursive-exclude * __pycache__ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/PKG-INFO new/dateparser-1.1.5/PKG-INFO --- old/dateparser-1.1.3/PKG-INFO 2022-11-03 11:53:37.067956200 +0100 +++ new/dateparser-1.1.5/PKG-INFO 2022-12-29 14:49:44.973840000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 2.1 Name: dateparser -Version: 1.1.3 +Version: 1.1.5 Summary: Date parsing library designed to parse dates from HTML pages Home-page: https://github.com/scrapinghub/dateparser Author: Scrapinghub -Author-email: i...@scrapinghub.com +Author-email: opensou...@zyte.com License: BSD Project-URL: History, https://dateparser.readthedocs.io/en/latest/history.html Keywords: dateparser @@ -13,13 +13,13 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Natural Language :: English 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 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython -Requires-Python: >=3.5 +Requires-Python: >=3.7 Provides-Extra: calendars Provides-Extra: fasttext Provides-Extra: langdetect @@ -287,6 +287,35 @@ History ======= +1.1.5 (2022-12-29) +------------------ + +Improvements: + +- Parse short versions of day, month, and year (#1103) +- Add a test for âin 1dâ (#1104) +- Update languages_info (#1107) +- Add a workaround for zipimporter not having exec_module before Python 3.10 (#1069) +- Stabilize tests at midnight (#1111) +- Add a test case for French (#1110) + +Cleanups: + +- Remove the requirements-build file (#1113) + + +1.1.4 (2022-11-21) +------------------ + +Improvements: + +- Improved support for languages such as Slovak, Indonesian, Hindi, German and Japanese (#1064, #1094, #986, #1071, #1068) +- Recursively create a model home (#996) +- Replace regex sub with simple string replace (#1095) +- Add Python 3.10, 3.11 support (#1096) +- Drop support for Python 3.5, 3.6 versions (#1097) + + 1.1.3 (2022-11-03) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/README.rst new/dateparser-1.1.5/README.rst --- old/dateparser-1.1.3/README.rst 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/README.rst 2022-12-29 14:49:35.000000000 +0100 @@ -156,7 +156,7 @@ Installation ------------ -Dateparser supports Python >= 3.5. You can install it by doing: +Dateparser supports Python >= 3.7. You can install it by doing: :: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/__init__.py new/dateparser-1.1.5/dateparser/__init__.py --- old/dateparser-1.1.3/dateparser/__init__.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/__init__.py 2022-12-29 14:49:35.000000000 +0100 @@ -1,4 +1,4 @@ -__version__ = '1.1.3' +__version__ = '1.1.5' from .date import DateDataParser from .conf import apply_settings diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/data/date_translation_data/de.py new/dateparser-1.1.5/dateparser/data/date_translation_data/de.py --- old/dateparser-1.1.3/dateparser/data/date_translation_data/de.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/data/date_translation_data/de.py 2022-12-29 14:49:35.000000000 +0100 @@ -37,6 +37,7 @@ ], "september": [ "sep", + "sept", "september" ], "october": [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/data/date_translation_data/en.py new/dateparser-1.1.5/dateparser/data/date_translation_data/en.py --- old/dateparser-1.1.3/dateparser/data/date_translation_data/en.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/data/date_translation_data/en.py 2022-12-29 14:49:35.000000000 +0100 @@ -87,11 +87,13 @@ "year": [ "year", "yr", + "y", "years" ], "month": [ "mo", "month", + "mon", "months" ], "week": [ @@ -101,6 +103,7 @@ ], "day": [ "day", + "d", "days" ], "hour": [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/data/date_translation_data/hi.py new/dateparser-1.1.5/dateparser/data/date_translation_data/hi.py --- old/dateparser-1.1.3/dateparser/data/date_translation_data/hi.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/data/date_translation_data/hi.py 2022-12-29 14:49:35.000000000 +0100 @@ -162,6 +162,12 @@ ], "2 day ago": [ "परसà¥à¤" + ], + "1 decade ago": [ + "पिà¤à¤²à¤¾ दशà¤" + ], + "in 1 decade": [ + "ठà¤à¤²à¤¾ दशà¤" ] }, "relative-type-regex": { @@ -212,6 +218,12 @@ ], "in \\1 year": [ "(\\d+[.,]?\\d*) वरà¥à¤· मà¥à¤" + ], + "in \\1 decade": [ + "(\\d+[.,]?\\d*) दशठमà¥à¤" + ], + "\\1 decade ago": [ + "(\\d+[.,]?\\d*) दशठपहलà¥" ] }, "locale_specific": {}, @@ -235,6 +247,9 @@ "ï¼" ], "sentence_splitter_group": 3, + "decade": [ + "दशà¤" + ], "ago": [ "पहलà¥", "पà¥à¤°à¥à¤µ" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/data/date_translation_data/id.py new/dateparser-1.1.5/dateparser/data/date_translation_data/id.py --- old/dateparser-1.1.3/dateparser/data/date_translation_data/id.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/data/date_translation_data/id.py 2022-12-29 14:49:35.000000000 +0100 @@ -193,7 +193,8 @@ ], "\\1 month ago": [ "(\\d+[.,]?\\d*) bln lalu", - "(\\d+[.,]?\\d*) bulan yang lalu" + "(\\d+[.,]?\\d*) bulan yang lalu", + "(\\d+[.,]?\\d*) bulan lalu" ], "\\1 second ago": [ "(\\d+[.,]?\\d*) detik yang lalu", @@ -205,7 +206,8 @@ ], "\\1 year ago": [ "(\\d+[.,]?\\d*) tahun yang lalu", - "(\\d+[.,]?\\d*) thn lalu" + "(\\d+[.,]?\\d*) thn lalu", + "(\\d+[.,]?\\d*) tahun lalu" ], "in \\1 day": [ "dalam (\\d+[.,]?\\d*) h", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/data/date_translation_data/ja.py new/dateparser-1.1.5/dateparser/data/date_translation_data/ja.py --- old/dateparser-1.1.3/dateparser/data/date_translation_data/ja.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/data/date_translation_data/ja.py 2022-12-29 14:49:35.000000000 +0100 @@ -172,6 +172,9 @@ ], "2 week ago": [ "å ã é±" + ], + "in 2 day": [ + "æå¾æ¥" ] }, "relative-type-regex": { @@ -250,6 +253,9 @@ "|", "ï¼" ], + "pertain": [ + "ã®" + ], "ago": [ "å" ], @@ -272,6 +278,9 @@ }, { "(\\d+[.,]?\\d*)æ$": "\\1:00" + }, + { + "æ£å": "12:00" } ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/data/date_translation_data/sk.py new/dateparser-1.1.5/dateparser/data/date_translation_data/sk.py --- old/dateparser-1.1.3/dateparser/data/date_translation_data/sk.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/data/date_translation_data/sk.py 2022-12-29 14:49:35.000000000 +0100 @@ -68,7 +68,8 @@ ], "wednesday": [ "st", - "streda" + "streda", + "stredu" ], "thursday": [ "Å¡t", @@ -80,11 +81,13 @@ ], "saturday": [ "so", - "sobota" + "sobota", + "sobotu" ], "sunday": [ "ne", - "nedeľa" + "nedeľa", + "nedeľu" ], "am": [ "am" @@ -165,6 +168,12 @@ ], "in 1 year": [ "budúci rok" + ], + "2 day ago": [ + "predvÄerom" + ], + "in 2 days": [ + "pozajtra" ] }, "relative-type-regex": { @@ -206,41 +215,50 @@ "in \\1 day": [ "o (\\d+[.,]?\\d*) d", "o (\\d+[.,]?\\d*) deÅ", - "o (\\d+[.,]?\\d*) dnÃ" + "o (\\d+[.,]?\\d*) dnÃ", + "o (\\d+[.,]?\\d*) dni" ], "in \\1 hour": [ "o (\\d+[.,]?\\d*) h", "o (\\d+[.,]?\\d*) hodinu", - "o (\\d+[.,]?\\d*) hodÃn" + "o (\\d+[.,]?\\d*) hodÃn", + "o (\\d+[.,]?\\d*) hodiny" ], "in \\1 minute": [ "o (\\d+[.,]?\\d*) min", "o (\\d+[.,]?\\d*) minút", - "o (\\d+[.,]?\\d*) minútu" + "o (\\d+[.,]?\\d*) minútu", + "o (\\d+[.,]?\\d*) minúty" ], "in \\1 month": [ "o (\\d+[.,]?\\d*) mes", "o (\\d+[.,]?\\d*) mesiac", - "o (\\d+[.,]?\\d*) mesiacov" + "o (\\d+[.,]?\\d*) mesiacov", + "o (\\d+[.,]?\\d*) mesiace" ], "in \\1 second": [ "o (\\d+[.,]?\\d*) s", "o (\\d+[.,]?\\d*) sekundu", - "o (\\d+[.,]?\\d*) sekúnd" + "o (\\d+[.,]?\\d*) sekúnd", + "o (\\d+[.,]?\\d*) sekundy" ], "in \\1 week": [ "o (\\d+[.,]?\\d*) týž", "o (\\d+[.,]?\\d*) týždeÅ", - "o (\\d+[.,]?\\d*) týždÅov" + "o (\\d+[.,]?\\d*) týždÅov", + "o (\\d+[.,]?\\d*) týždne" ], "in \\1 year": [ "o (\\d+[.,]?\\d*) r", "o (\\d+[.,]?\\d*) rok", - "o (\\d+[.,]?\\d*) rokov" + "o (\\d+[.,]?\\d*) rokov", + "o (\\d+[.,]?\\d*) roky" ] }, "locale_specific": {}, "skip": [ + "v", + "vo", " ", "'", ",", @@ -253,5 +271,57 @@ "]", "|", "ï¼" + ], + "sentence_splitter_group": 1, + "ago": [ + "pred" + ], + "in": [ + "o", + "za" + ], + "simplifications": [ + { + "pred sekundou": "pred 1 sekundou" + }, + { + "pred minútou": "pred 1 minútou" + }, + { + "pred hodinou": "pred 1 hodinou" + }, + { + "pred týždÅom": "pred 1 týždÅom" + }, + { + "pred mesiacom": "pred 1 mesiacom" + }, + { + "pred rokom": "pred 1 rokom" + }, + { + "pred pol rokom": "pred 6 mesiacmi" + }, + { + "o sekundu": "o 1 sekundu" + }, + { + "o minútu": "o 1 minútu" + }, + { + "o hodinu": "o 1 hodinu" + }, + { + "o týždeÅ": "o 1 týždeÅ" + }, + { + "o mesiac": "o 1 mesiac" + }, + { + "o rok": "o 1 rok" + }, + { + "o pol roka": "o 6 mesiacov" + } ] } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/data/languages_info.py new/dateparser-1.1.5/dateparser/data/languages_info.py --- old/dateparser-1.1.3/dateparser/data/languages_info.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/data/languages_info.py 2022-12-29 14:49:35.000000000 +0100 @@ -3,27 +3,27 @@ "ru", "es", "de", - "tr", "fr", - "fa", "ja", + "tr", + "fa", "zh", "zh-Hans", - "vi", "it", - "nl", + "vi", "pt", - "ar", + "nl", "pl", - "id", + "ar", "ko", + "id", "uk", + "cs", "th", "he", - "cs", "sv", - "ro", "el", + "ro", "da", "hu", "fi", @@ -34,10 +34,11 @@ "nb", "hr", "lt", - "hi", "sl", + "hi", "ca", "et", + "lv", "bn", "ur", "sw", @@ -137,7 +138,6 @@ "nn", "kde", "mfe", - "lv", "seh", "mgh", "az-Cyrl", @@ -944,9 +944,6 @@ "de-LI", "de-LU" ], - "tr": [ - "tr-CY" - ], "fr": [ "fr-BE", "fr-BF", @@ -994,30 +991,25 @@ "fr-WF", "fr-YT" ], + "ja": [], + "tr": [ + "tr-CY" + ], "fa": [ "fa-AF" ], - "ja": [], "zh": [], "zh-Hans": [ "zh-Hans-HK", "zh-Hans-MO", "zh-Hans-SG" ], - "vi": [], "it": [ "it-CH", "it-SM", "it-VA" ], - "nl": [ - "nl-AW", - "nl-BE", - "nl-BQ", - "nl-CW", - "nl-SR", - "nl-SX" - ], + "vi": [], "pt": [ "pt-AO", "pt-CH", @@ -1031,6 +1023,15 @@ "pt-ST", "pt-TL" ], + "nl": [ + "nl-AW", + "nl-BE", + "nl-BQ", + "nl-CW", + "nl-SR", + "nl-SX" + ], + "pl": [], "ar": [ "ar-AE", "ar-BH", @@ -1060,25 +1061,24 @@ "ar-TN", "ar-YE" ], - "pl": [], - "id": [], "ko": [ "ko-KP" ], + "id": [], "uk": [], + "cs": [], "th": [], "he": [], - "cs": [], "sv": [ "sv-AX", "sv-FI" ], - "ro": [ - "ro-MD" - ], "el": [ "el-CY" ], + "ro": [ + "ro-MD" + ], "da": [ "da-GL" ], @@ -1099,14 +1099,15 @@ "hr-BA" ], "lt": [], - "hi": [], "sl": [], + "hi": [], "ca": [ "ca-AD", "ca-FR", "ca-IT" ], "et": [], + "lv": [], "bn": [ "bn-IN" ], @@ -1274,7 +1275,6 @@ "nn": [], "kde": [], "mfe": [], - "lv": [], "seh": [], "mgh": [], "az-Cyrl": [], diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/date.py new/dateparser-1.1.5/dateparser/date.py --- old/dateparser-1.1.3/dateparser/date.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/date.py 2022-12-29 14:49:35.000000000 +0100 @@ -303,12 +303,7 @@ setattr(self, k, v) def __repr__(self): - if sys.version_info < (3, 6): # python 3.5 compatibility - properties_text = "date_obj={}, period={}, locale={}".format( - self.date_obj.__repr__(), self.period.__repr__(), self.locale.__repr__() - ) - else: - properties_text = ', '.join('{}={}'.format(prop, val.__repr__()) for prop, val in self.__dict__.items()) + properties_text = ', '.join('{}={}'.format(prop, val.__repr__()) for prop, val in self.__dict__.items()) return '{}({})'.format( self.__class__.__name__, properties_text @@ -465,10 +460,7 @@ def get_date_tuple(self, *args, **kwargs): date_data = self.get_date_data(*args, **kwargs) - if sys.version_info < (3, 6): # python 3.5 compatibility - fields = ['date_obj', 'period', 'locale'] - else: - fields = date_data.__dict__.keys() + fields = date_data.__dict__.keys() date_tuple = collections.namedtuple('DateData', fields) return date_tuple(**date_data.__dict__) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/languages/locale.py new/dateparser-1.1.5/dateparser/languages/locale.py --- old/dateparser-1.1.3/dateparser/languages/locale.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/languages/locale.py 2022-12-29 14:49:35.000000000 +0100 @@ -10,7 +10,6 @@ from .dictionary import Dictionary, NormalizedDictionary, ALWAYS_KEEP_TOKENS -DIGIT_GROUP_PATTERN = re.compile(r'\\d\+') NUMERAL_PATTERN = re.compile(r'(\d+)', re.U) @@ -170,7 +169,7 @@ if normalize: value = list(map(normalize_unicode, value)) pattern = '|'.join(sorted(value, key=len, reverse=True)) - pattern = DIGIT_GROUP_PATTERN.sub(r'?P<n>\d+', pattern) + pattern = pattern.replace(r'(\d+', r'(?P<n>\d+') pattern = re.compile(r'^(?:{})$'.format(pattern), re.UNICODE | re.IGNORECASE) relative_dictionary[pattern] = key return relative_dictionary diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser/utils/strptime.py new/dateparser-1.1.5/dateparser/utils/strptime.py --- old/dateparser-1.1.3/dateparser/utils/strptime.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser/utils/strptime.py 2022-12-29 14:49:35.000000000 +0100 @@ -14,6 +14,14 @@ MS_SEARCHER = re.compile(r'\.(?P<microsecond>[0-9]{1,6})') +def _exec_module(spec, module): + if hasattr(spec.loader, "exec_module"): + spec.loader.exec_module(module) + else: + # This can happen before Python 3.10 + # if spec.loader is a zipimporter and the Python runtime is in a zipfile + code = spec.loader.get_code(module.__name__) + exec(code, module.__dict__) def patch_strptime(): """Monkey patching _strptime to avoid problems related with non-english @@ -23,13 +31,12 @@ any date since all languages are translated to english dates. """ _strptime_spec = importlib.util.find_spec('_strptime') - _strptime = importlib.util.module_from_spec(_strptime_spec) - _strptime_spec.loader.exec_module(_strptime) + _exec_module(_strptime_spec, _strptime) sys.modules['strptime_patched'] = _strptime _calendar = importlib.util.module_from_spec(_strptime_spec) - _strptime_spec.loader.exec_module(_calendar) + _exec_module(_strptime_spec, _calendar) sys.modules['calendar_patched'] = _calendar _strptime._getlang = lambda: ('en_US', 'UTF-8') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser.egg-info/PKG-INFO new/dateparser-1.1.5/dateparser.egg-info/PKG-INFO --- old/dateparser-1.1.3/dateparser.egg-info/PKG-INFO 2022-11-03 11:53:36.000000000 +0100 +++ new/dateparser-1.1.5/dateparser.egg-info/PKG-INFO 2022-12-29 14:49:44.000000000 +0100 @@ -1,10 +1,10 @@ Metadata-Version: 2.1 Name: dateparser -Version: 1.1.3 +Version: 1.1.5 Summary: Date parsing library designed to parse dates from HTML pages Home-page: https://github.com/scrapinghub/dateparser Author: Scrapinghub -Author-email: i...@scrapinghub.com +Author-email: opensou...@zyte.com License: BSD Project-URL: History, https://dateparser.readthedocs.io/en/latest/history.html Keywords: dateparser @@ -13,13 +13,13 @@ Classifier: License :: OSI Approved :: BSD License Classifier: Natural Language :: English 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 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: Implementation :: CPython -Requires-Python: >=3.5 +Requires-Python: >=3.7 Provides-Extra: calendars Provides-Extra: fasttext Provides-Extra: langdetect @@ -287,6 +287,35 @@ History ======= +1.1.5 (2022-12-29) +------------------ + +Improvements: + +- Parse short versions of day, month, and year (#1103) +- Add a test for âin 1dâ (#1104) +- Update languages_info (#1107) +- Add a workaround for zipimporter not having exec_module before Python 3.10 (#1069) +- Stabilize tests at midnight (#1111) +- Add a test case for French (#1110) + +Cleanups: + +- Remove the requirements-build file (#1113) + + +1.1.4 (2022-11-21) +------------------ + +Improvements: + +- Improved support for languages such as Slovak, Indonesian, Hindi, German and Japanese (#1064, #1094, #986, #1071, #1068) +- Recursively create a model home (#996) +- Replace regex sub with simple string replace (#1095) +- Add Python 3.10, 3.11 support (#1096) +- Drop support for Python 3.5, 3.6 versions (#1097) + + 1.1.3 (2022-11-03) ------------------ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser.egg-info/SOURCES.txt new/dateparser-1.1.5/dateparser.egg-info/SOURCES.txt --- old/dateparser-1.1.3/dateparser.egg-info/SOURCES.txt 2022-11-03 11:53:36.000000000 +0100 +++ new/dateparser-1.1.5/dateparser.egg-info/SOURCES.txt 2022-12-29 14:49:44.000000000 +0100 @@ -4,7 +4,6 @@ LICENSE MANIFEST.in README.rst -requirements-build.txt setup.cfg setup.py dateparser/__init__.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser.egg-info/requires.txt new/dateparser-1.1.5/dateparser.egg-info/requires.txt --- old/dateparser-1.1.3/dateparser.egg-info/requires.txt 2022-11-03 11:53:36.000000000 +0100 +++ new/dateparser-1.1.5/dateparser.egg-info/requires.txt 2022-12-29 14:49:44.000000000 +0100 @@ -1,12 +1,9 @@ python-dateutil pytz -regex!=2019.02.19,!=2021.8.27,<2022.3.15 +regex!=2019.02.19,!=2021.8.27 tzlocal -[calendars:python_version<"3.6"] -convertdate - -[calendars:python_version>="3.6"] +[calendars] hijri-converter convertdate diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/dateparser_cli/utils.py new/dateparser-1.1.5/dateparser_cli/utils.py --- old/dateparser-1.1.3/dateparser_cli/utils.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/dateparser_cli/utils.py 2022-12-29 14:49:35.000000000 +0100 @@ -5,10 +5,7 @@ DEFAULT_DIR_NAME = 'dateparser_models' DEFAULT_UNIX_CACHE_DIR = '~/.cache' -if sys.version_info < (3, 6): # python 3.5 compatibility - DEFAULT_WINDOWS_CACHE_DIR = os.path.join(str(Path.home()), "AppData", "Roaming") -else: - DEFAULT_WINDOWS_CACHE_DIR = os.path.join(Path.home(), "AppData", "Roaming") +DEFAULT_WINDOWS_CACHE_DIR = os.path.join(Path.home(), "AppData", "Roaming") if sys.platform.startswith('win'): @@ -24,8 +21,7 @@ def create_data_model_home(): - if not os.path.isdir(dateparser_model_home): - os.makedirs(dateparser_model_home, exist_ok=True) + os.makedirs(dateparser_model_home, exist_ok=True) def clear_cache(*args): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/requirements-build.txt new/dateparser-1.1.5/requirements-build.txt --- old/dateparser-1.1.3/requirements-build.txt 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/requirements-build.txt 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -wheel==0.23.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/setup.py new/dateparser-1.1.5/setup.py --- old/dateparser-1.1.3/setup.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/setup.py 2022-12-29 14:49:35.000000000 +0100 @@ -16,7 +16,7 @@ description='Date parsing library designed to parse dates from HTML pages', long_description=introduction + '\n\n' + history, author='Scrapinghub', - author_email='i...@scrapinghub.com', + author_email='opensou...@zyte.com', url='https://github.com/scrapinghub/dateparser', project_urls={ 'History': 'https://dateparser.readthedocs.io/en/latest/history.html', @@ -27,33 +27,32 @@ 'python-dateutil', 'pytz', # https://bitbucket.org/mrabarnett/mrab-regex/issues/314/import-error-no-module-named - 'regex !=2019.02.19,!=2021.8.27,<2022.3.15', + 'regex !=2019.02.19,!=2021.8.27', 'tzlocal', ], entry_points={ 'console_scripts': ['dateparser-download = dateparser_cli.cli:entrance'], }, extras_require={ - 'calendars:python_version<"3.6"': ['convertdate'], - 'calendars:python_version>="3.6"': ['hijri-converter', 'convertdate'], + 'calendars': ['hijri-converter', 'convertdate'], 'fasttext': ['fasttext'], 'langdetect': ['langdetect'], }, license="BSD", zip_safe=False, keywords='dateparser', - python_requires='>=3.5', + python_requires='>=3.7', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Natural Language :: English', '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', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', 'Programming Language :: Python :: Implementation :: CPython', ], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/tests/test_date.py new/dateparser-1.1.5/tests/test_date.py --- old/dateparser-1.1.3/tests/test_date.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/tests/test_date.py 2022-12-29 14:49:35.000000000 +0100 @@ -354,6 +354,8 @@ param(' Yesterday \n', days_ago=1), param('Ontem', days_ago=1), param('Ieri', days_ago=1), + param(u'вÑеÑа', days_ago=1), + param(u'ÑноÑи', days_ago=1), # Day before yesterday param('the day before yesterday', days_ago=2), param('The DAY before Yesterday', days_ago=2), @@ -523,11 +525,12 @@ self.then_returned_tuple_is(expected_result) def given_now(self, year, month, day, **time): + now = datetime(year, month, day, **time) datetime_mock = Mock(wraps=datetime) - datetime_mock.utcnow = Mock(return_value=datetime(year, month, day, **time)) - self.add_patch( - patch('dateparser.date_parser.datetime', new=datetime_mock) - ) + datetime_mock.utcnow = Mock(return_value=now) + datetime_mock.now = Mock(return_value=now) + datetime_mock.today = Mock(return_value=now) + self.add_patch(patch('dateparser.date.datetime', new=datetime_mock)) def given_parser(self, restrict_to_languages=None, **params): self.parser = date.DateDataParser(languages=restrict_to_languages, **params) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/tests/test_date_parser.py new/dateparser-1.1.5/tests/test_date_parser.py --- old/dateparser-1.1.3/tests/test_date_parser.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/tests/test_date_parser.py 2022-12-29 14:49:35.000000000 +0100 @@ -117,6 +117,7 @@ param('21. Dezember 2013', datetime(2013, 12, 21)), param('19. Februar 2012', datetime(2012, 2, 19)), param('26. Juli 2014', datetime(2014, 7, 26)), + param('1. Sept 2000', datetime(2000, 9, 1)), param('18.10.14 um 22:56 Uhr', datetime(2014, 10, 18, 22, 56)), param('12-Mär-2014', datetime(2014, 3, 12)), param('Mit 13:14', datetime(2012, 11, 7, 13, 14)), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/tests/test_freshness_date_parser.py new/dateparser-1.1.5/tests/test_freshness_date_parser.py --- old/dateparser-1.1.3/tests/test_freshness_date_parser.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/tests/test_freshness_date_parser.py 2022-12-29 14:49:35.000000000 +0100 @@ -72,6 +72,7 @@ param('an hour ago', ago={'hours': 1}, period='day'), param('about an hour ago', ago={'hours': 1}, period='day'), param('a day ago', ago={'days': 1}, period='day'), + param('1d ago', ago={'days': 1}, period='day'), param('a week ago', ago={'weeks': 1}, period='week'), param('2 hours ago', ago={'hours': 2}, period='day'), param('about 23 hours ago', ago={'hours': 23}, period='day'), @@ -96,8 +97,10 @@ param('nine hours ago', ago={'hours': 9}, period='day'), param('three week ago', ago={'weeks': 3}, period='week'), param('eight months ago', ago={'months': 8}, period='month'), + param('1mon ago', ago={'months': 1}, period='month'), param('six days ago', ago={'days': 6}, period='day'), param('five years ago', ago={'years': 5}, period='year'), + param('2y ago', ago={'years': 2}, period='year'), # Fractional units param('2.5 hours', ago={'hours': 2.5}, period='day'), param('10.75 minutes', ago={'minutes': 10.75}, period='day'), @@ -359,6 +362,8 @@ param('1 वरà¥à¤·, 8 महà¥à¤¨à¥, 2 सपà¥à¤¤à¤¾à¤¹', ago={'years': 1, 'months': 8, 'weeks': 2}, period='week'), param('1 वरà¥à¤· 7 महà¥à¤¨à¥', ago={'years': 1, 'months': 7}, period='month'), param('à¤à¤', ago={'days': 0}, period='day'), + param('1 दशà¤', ago={'years': 10}, period='year'), + param('1 दशठपहलà¥', ago={'years': 10}, period='year'), # af param("2 uur gelede", ago={'hours': 2}, period='day'), @@ -464,6 +469,11 @@ param("pÅed 12 lÄtom 15 mÄsac", ago={'years': 12, 'months': 15}, period='month'), # hy param("15 ÖÕ¸ÕºÕ¥ Õ¡Õ¼Õ¡Õ»", ago={'minutes': 15}, period='day'), + # id + param("4 tahun lalu", ago={'years': 4}, period='year'), + param("4 thn lalu", ago={'years': 4}, period='year'), + param("4 bulan lalu", ago={'months': 4}, period='month'), + param("4 bln lalu", ago={'months': 4}, period='month'), # is param("fyrir 3 ári fyrir 2 mánuði", ago={'years': 3, 'months': 2}, period='month'), # it @@ -530,6 +540,14 @@ param("මà·à¶±à·à¶à·à¶à· 6à¶à¶§ à¶´à·à¶»", ago={'minutes': 6}, period='day'), # sk param("pred 20 hodinami 45 min", ago={'hours': 20, 'minutes': 45}, period='day'), + param('dnes', ago={'days': 0}, period='day'), + param('vÄera', ago={'days': 1}, period='day'), + param('predvÄerom', ago={'days': 2}, period='day'), + param('pred 2 hodinami', ago={'hours': 2}, period='day'), + param('pred rokom', ago={'years': 1}, period='year'), + param('pred týždÅom', ago={'weeks': 1}, period='week'), + param('pred 3 dÅami', ago={'days': 3}, period='day'), + param('pred hodinou', ago={'hours': 1}, period='day'), # sl param("pred 15 tednom 10 dan", ago={'weeks': 15, 'days': 10}, period='day'), # sq @@ -854,6 +872,7 @@ param('1 वरà¥à¤·, 8 महà¥à¤¨à¥, 2 सपà¥à¤¤à¤¾à¤¹', ago={'years': 1, 'months': 8, 'weeks': 2}, period='week'), param('1 वरà¥à¤· 7 महà¥à¤¨à¥', ago={'years': 1, 'months': 7}, period='month'), param('à¤à¤', ago={'days': 0}, period='day'), + param('1 दशठपहलà¥', ago={'years': 10}, period='year'), # af param("2 uur gelede", ago={'hours': 2}, period='day'), @@ -1093,6 +1112,7 @@ param('in an hour', in_future={'hours': 1}, period='day'), param('in about an hour', in_future={'hours': 1}, period='day'), param('in 1 day', in_future={'days': 1}, period='day'), + param('in 1d', in_future={'days': 1}, period='day'), param('in a week', in_future={'weeks': 1}, period='week'), param('in 2 hours', in_future={'hours': 2}, period='day'), param('in about 23 hours', in_future={'hours': 23}, period='day'), @@ -1182,6 +1202,7 @@ param('17 सà¥à¤à¤à¤¡ बाद', in_future={'seconds': 17}, period='day'), param('1 वरà¥à¤·, 5 महà¥à¤¨à¥, 1 सपà¥à¤¤à¤¾à¤¹ मà¥à¤', in_future={'years': 1, 'months': 5, 'weeks': 1}, period='week'), + param('1 दशठमà¥à¤', in_future={'years': 10}, period='year'), # af param("oor 10 jaar", in_future={'years': 10}, period='year'), @@ -1470,6 +1491,7 @@ @parameterized.expand([ param('15th of Aug, 2014 Diane Bennett'), + param('4 heures ago'), ]) def test_insane_dates(self, date_string): self.given_parser() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/tests/test_hijri.py new/dateparser-1.1.5/tests/test_hijri.py --- old/dateparser-1.1.3/tests/test_hijri.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/tests/test_hijri.py 2022-12-29 14:49:35.000000000 +0100 @@ -6,16 +6,9 @@ from tests import BaseTestCase -is_python_supported = sys.version_info >= (3, 6) +from dateparser.calendars.hijri import HijriCalendar -try: - from dateparser.calendars.hijri import HijriCalendar -except ImportError: - if is_python_supported: - raise - -@unittest.skipUnless(is_python_supported, "hijri-converter doesn't support Python<3.6") class TestHijriParser(BaseTestCase): def setUp(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/tests/test_languages.py new/dateparser-1.1.5/tests/test_languages.py --- old/dateparser-1.1.3/tests/test_languages.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/tests/test_languages.py 2022-12-29 14:49:35.000000000 +0100 @@ -191,6 +191,8 @@ param('ja', "2016å¹´3æ21æ¥(æ) 14æ48å", "2016-3-21 monday 14:48"), param('ja', "2016å¹´3æ20æ¥(æ¥) 21æ40å", "2016-3-20 sunday 21:40"), param('ja', "2016å¹´3æ20æ¥ (æ¥) 21æ40å", "2016-3-20 sunday 21:40"), + param('ja', "æ£å", "12:00"), + param('ja', "ææ¥ã®13æ20å", "in 1 day 13:20"), # Hebrew param('he', "20 ××פר×× 2012", "20 april 2012"), @@ -738,6 +740,10 @@ # sk param('sk', "15 marec 1987 utorok", "15 march 1987 tuesday"), param('sk', "streda 17 mája 2003", "wednesday 17 may 2003"), + param('sk', "o 2 mesiace", "in 2 month"), + param('sk', "o týždeÅ", "in 1 week"), + param('sk', "predvÄerom", "2 day ago"), + param('sk', "v sobotu", " saturday"), # sl param('sl', "12 junij 2003 petek 10:09 pop", "12 june 2003 friday 10:09 pm"), @@ -1066,6 +1072,7 @@ param('ja', "60ç§", "60 second"), param('ja', "3ç§å", "3 second ago"), param('ja', "ç¾å¨", "0 second ago"), + param('ja', "æå¾æ¥", "in 2 day"), # Hebrew param('he', "×ת×××", "1 day ago"), param('he', "×ת××× ××©×¢× 3", "1 day ago 3"), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/dateparser-1.1.3/tests/test_search.py new/dateparser-1.1.5/tests/test_search.py --- old/dateparser-1.1.3/tests/test_search.py 2022-11-03 11:53:19.000000000 +0100 +++ new/dateparser-1.1.5/tests/test_search.py 2022-12-29 14:49:35.000000000 +0100 @@ -8,6 +8,8 @@ import datetime import pytz +today = datetime.datetime.today() + class TestTranslateSearch(BaseTestCase): def setUp(self): @@ -189,6 +191,9 @@ param('ja', "2016å¹´3æ21æ¥(æ) 14æ48å"), param('ja', "2016å¹´3æ20æ¥(æ¥) 21æ40å"), param('ja', "2016å¹´3æ20æ¥ (æ¥) 21æ40å"), + param('ja', "æ£å"), + param('ja', "æå¾æ¥"), + param('ja', "æå¾æ¥ã®æ£å"), # Hebrew param('he', "20 ××פר×× 2012"), @@ -457,10 +462,8 @@ ('February 1st', datetime.datetime(2017, 2, 1, 0, 0))]), param('en', '2014 was good! October was excellent!' ' Friday, 21 was especially good!', - [('2014', datetime.datetime( - 2014, datetime.datetime.utcnow().month, datetime.datetime.utcnow().day, 0, 0) - ), - ('October', datetime.datetime(2014, 10, datetime.datetime.utcnow().day, 0, 0)), + [('2014', datetime.datetime(2014, today.month, today.day, 0, 0)), + ('October', datetime.datetime(2014, 10, today.day, 0, 0)), ('Friday, 21', datetime.datetime(2014, 10, 21, 0, 0))]), param('en', """May 2020 July 2020 @@ -526,9 +529,7 @@ ('July 13th', datetime.datetime(2014, 7, 13, 0, 0)), ('July 14th', datetime.datetime(2014, 7, 14, 0, 0))]), param('en', '2014. July 13th July 14th', - [('2014', datetime.datetime( - 2014, datetime.datetime.utcnow().month, datetime.datetime.utcnow().day, 0, 0) - ), + [('2014', datetime.datetime(2014, today.month, today.day, 0, 0)), ('July 13th', datetime.datetime(2014, 7, 13, 0, 0)), ('July 14th', datetime.datetime(2014, 7, 14, 0, 0))]), param('en', 'July 13th 2014 July 14th 2014', @@ -541,9 +542,7 @@ [('July 13th, 2014', datetime.datetime(2014, 7, 13, 0, 0)), ('July 14th, 2014', datetime.datetime(2014, 7, 14, 0, 0))]), param('en', '2014. July 12th, July 13th, July 14th', - [('2014', datetime.datetime( - 2014, datetime.datetime.utcnow().month, datetime.datetime.utcnow().day, 0, 0) - ), + [('2014', datetime.datetime(2014, today.month, today.day, 0, 0)), ('July 12th', datetime.datetime(2014, 7, 12, 0, 0)), ('July 13th', datetime.datetime(2014, 7, 13, 0, 0)), ('July 14th', datetime.datetime(2014, 7, 14, 0, 0))]), @@ -551,13 +550,8 @@ # Swedish param('sv', '1938â1939 marscherade tyska soldater i Ãsterrike samtidigt som ' 'österrikiska soldater marscherade i Berlin.', - [('1938', datetime.datetime( - 1938, datetime.datetime.utcnow().month, datetime.datetime.utcnow().day, 0, 0) - ), - ('1939', datetime.datetime( - 1939, datetime.datetime.utcnow().month, datetime.datetime.utcnow().day, 0, 0) - )]), - + [('1938', datetime.datetime(1938, today.month, today.day, 0, 0)), + ('1939', datetime.datetime(1939, today.month, today.day, 0, 0))]), # German param('de', 'Verteidiger der Stadt kapitulierten am 2. Mai 1945. Am 8. Mai 1945 (VE-Day) trat ' 'bedingungslose Kapitulation der Wehrmacht in Kraft',