Compare commits

1 Commits
main ... 1.1

5 changed files with 36 additions and 57 deletions

BIN
dateparser-1.1.8.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
dateparser-1.2.0.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@@ -2,16 +2,19 @@
tests/test_language_detect.py | 6 +++++- tests/test_language_detect.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-) 1 file changed, 5 insertions(+), 1 deletion(-)
Index: dateparser-1.2.0/tests/test_language_detect.py --- a/tests/test_language_detect.py
=================================================================== +++ b/tests/test_language_detect.py
--- dateparser-1.2.0.orig/tests/test_language_detect.py @@ -1,6 +1,8 @@
+++ dateparser-1.2.0/tests/test_language_detect.py
@@ -1,3 +1,4 @@
+import os +import os
import unittest +import unittest
+
from datetime import datetime from datetime import datetime
from unittest.mock import Mock from unittest.mock import Mock
@@ -17,6 +18,7 @@ from dateparser.search import search_dat -import unittest
from parameterized import parameterized, param
@@ -13,6 +15,7 @@ from dateparser.search import search_dat
detect_languages = Mock() detect_languages = Mock()
detect_languages.return_value = ["en"] detect_languages.return_value = ["en"]
@@ -19,10 +22,10 @@ Index: dateparser-1.2.0/tests/test_language_detect.py
class CustomLangDetectParserTest(unittest.TestCase): class CustomLangDetectParserTest(unittest.TestCase):
def check_is_returned_list(self): def check_is_returned_list(self):
@@ -28,6 +30,7 @@ class CustomLangDetectParserTest(unittes @@ -22,6 +25,7 @@ class CustomLangDetectParserTest(unittes
param(dt_string="26 July 2021", confidence_threshold=0.0), param(dt_string="14 June 2020", confidence_threshold=0.0),
] param(dt_string="26 July 2021", confidence_threshold=0.0)
) ])
+ @unittest.skipIf(NO_NETWORK, "Test requires network access") + @unittest.skipIf(NO_NETWORK, "Test requires network access")
def test_custom_language_detect_fast_text(self, dt_string, confidence_threshold): def test_custom_language_detect_fast_text(self, dt_string, confidence_threshold):
self.result = fast_text_detect_languages(dt_string, confidence_threshold) self.result = fast_text_detect_languages(dt_string, confidence_threshold)

View File

@@ -1,27 +1,3 @@
-------------------------------------------------------------------
Thu Dec 7 20:46:37 UTC 2023 - Dirk Müller <dmueller@suse.com>
- update to 1.2.0:
* New ``PREFER_MONTH_OF_YEAR`` setting (#1146)
* Absolute years in Russian are no longer being treated as a
number of years in the past (#1129)
* Cleanups and internal improvements:
* Removed the use of ``datetime.utcnow``, deprecated on Python
3.12 (#1179)
* Applied Black formatting to the code base (#1158)
* Initial integration with OSSFuzz (#1198)
* Extended test cases (#1191)
-------------------------------------------------------------------
Sat Oct 14 00:54:16 UTC 2023 - Matej Cepl <mcepl@cepl.eu>
- Clean up the SPEC file
-------------------------------------------------------------------
Thu Sep 7 07:09:28 UTC 2023 - Dirk Müller <dmueller@suse.com>
- remove unneeded GitPython dependency
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Apr 21 12:24:07 UTC 2023 - Dirk Müller <dmueller@suse.com> Fri Apr 21 12:24:07 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@@ -16,9 +16,11 @@
# #
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
%{?sle15_python_module_pythons} %{?sle15_python_module_pythons}
Name: python-dateparser Name: python-dateparser
Version: 1.2.0 Version: 1.1.8
Release: 0 Release: 0
Summary: Date parsing library designed to parse dates from HTML pages Summary: Date parsing library designed to parse dates from HTML pages
License: BSD-3-Clause License: BSD-3-Clause
@@ -27,22 +29,20 @@ Source: https://files.pythonhosted.org/packages/source/d/dateparser/date
# PATCH-FIX-UPSTREAM mark-network-tests.patch gh#scrapinghub/dateparser#1059 mcepl@suse.com # PATCH-FIX-UPSTREAM mark-network-tests.patch gh#scrapinghub/dateparser#1059 mcepl@suse.com
# mark test requiring network access # mark test requiring network access
Patch1: mark-network-tests.patch Patch1: mark-network-tests.patch
BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: python-rpm-macros BuildRequires: python-rpm-macros
Requires: python-python-dateutil Requires: python-python-dateutil
Requires: python-pytz Requires: python-pytz
Requires: python-regex Requires: python-regex
Requires: python-tzlocal Requires: python-tzlocal
Requires(post): update-alternatives
Requires(postun):update-alternatives
Recommends: convertdate Recommends: convertdate
Recommends: python-fasttext Recommends: python-fasttext
Recommends: python-langdetect Recommends: python-langdetect
Recommends: python-ruamel.yaml Recommends: python-ruamel.yaml
BuildArch: noarch BuildArch: noarch
# SECTION test requirements # SECTION test requirements
BuildRequires: %{python_module GitPython}
BuildRequires: %{python_module convertdate} BuildRequires: %{python_module convertdate}
BuildRequires: %{python_module fasttext} BuildRequires: %{python_module fasttext}
BuildRequires: %{python_module langdetect} BuildRequires: %{python_module langdetect}
@@ -54,6 +54,8 @@ BuildRequires: %{python_module regex}
BuildRequires: %{python_module ruamel.yaml} BuildRequires: %{python_module ruamel.yaml}
BuildRequires: %{python_module tzlocal} BuildRequires: %{python_module tzlocal}
# /SECTION # /SECTION
Requires(post): update-alternatives
Requires(postun):update-alternatives
%python_subpackages %python_subpackages
%description %description
@@ -70,10 +72,10 @@ sed -i '1{/\/usr\/bin\/env python/d;}' \
dateparser_scripts/update_supported_languages_and_locales.py dateparser_scripts/update_supported_languages_and_locales.py
%build %build
%pyproject_wheel %python_build
%install %install
%pyproject_install %python_install
%python_clone -a %{buildroot}%{_bindir}/dateparser-download %python_clone -a %{buildroot}%{_bindir}/dateparser-download
%python_expand %fdupes %{buildroot}%{$python_sitelib} %python_expand %fdupes %{buildroot}%{$python_sitelib}
@@ -83,9 +85,7 @@ export NO_NETWORK=1
ignoretestfiles="--ignore tests/test_dateparser_data_integrity.py" ignoretestfiles="--ignore tests/test_dateparser_data_integrity.py"
# https://github.com/scrapinghub/dateparser/issues/1053 # https://github.com/scrapinghub/dateparser/issues/1053
ignoretestfiles="$ignoretestfiles --ignore tests/test_search.py" ignoretestfiles="$ignoretestfiles --ignore tests/test_search.py"
# overflow on 32bit %pytest $ignoretestfiles
donttest="(not test_timezone_offset_calculation)"
%pytest -k "$donttest" $ignoretestfiles
%post %post
%python_install_alternative dateparser-download %python_install_alternative dateparser-download