From 0ba4faa6b07d2bd12fc84c62f09da787f65818b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 27 Nov 2022 12:31:56 -0800 Subject: [PATCH] python310Packages.dateparser: 1.1.3 -> 1.1.4 https://github.com/scrapinghub/dateparser/blob/v1.1.4/HISTORY.rst --- .../python-modules/dateparser/default.nix | 21 +++++++------------ .../dateparser/regex-compat.patch | 11 ---------- 2 files changed, 7 insertions(+), 25 deletions(-) delete mode 100644 pkgs/development/python-modules/dateparser/regex-compat.patch diff --git a/pkgs/development/python-modules/dateparser/default.nix b/pkgs/development/python-modules/dateparser/default.nix index ca9e2f823748..7db2e1d15b74 100644 --- a/pkgs/development/python-modules/dateparser/default.nix +++ b/pkgs/development/python-modules/dateparser/default.nix @@ -1,6 +1,6 @@ { lib , buildPythonPackage -, isPy3k +, pythonOlder , fetchFromGitHub , fetchpatch , python-dateutil @@ -21,27 +21,19 @@ buildPythonPackage rec { pname = "dateparser"; - version = "1.1.3"; + version = "1.1.4"; - disabled = !isPy3k; + disabled = pythonOlder "3.7"; + + format = "setuptools"; src = fetchFromGitHub { owner = "scrapinghub"; repo = "dateparser"; rev = "v${version}"; - sha256 = "sha256-2bZaaaLT3hocIiqLZpudP6gmiYwxPNMrjG9dYF3GvTc="; + sha256 = "sha256-r13WNI+T2NtTwjnGOqX3ZOqPhvr8fBdXGULW7IXszlo="; }; - patches = [ - ./regex-compat.patch - ]; - - postPatch = '' - substituteInPlace setup.py --replace \ - 'regex !=2019.02.19,!=2021.8.27,<2022.3.15' \ - 'regex' - ''; - propagatedBuildInputs = [ python-dateutil pytz @@ -80,6 +72,7 @@ buildPythonPackage rec { pythonImportsCheck = [ "dateparser" ]; meta = with lib; { + changelog = "https://github.com/scrapinghub/dateparser/blob/${src.rev}/HISTORY.rst"; description = "Date parsing library designed to parse dates from HTML pages"; homepage = "https://github.com/scrapinghub/dateparser"; license = licenses.bsd3; diff --git a/pkgs/development/python-modules/dateparser/regex-compat.patch b/pkgs/development/python-modules/dateparser/regex-compat.patch deleted file mode 100644 index 4c69d14f1023..000000000000 --- a/pkgs/development/python-modules/dateparser/regex-compat.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- a/dateparser/languages/locale.py -+++ b/dateparser/languages/locale.py -@@ -169,7 +169,7 @@ class Locale: - if normalize: - value = list(map(normalize_unicode, value)) - pattern = '|'.join(sorted(value, key=len, reverse=True)) -- pattern = DIGIT_GROUP_PATTERN.sub(r'?P\d+', pattern) -+ pattern = pattern.replace(r'\d+', r'?P\d+') - pattern = re.compile(r'^(?:{})$'.format(pattern), re.UNICODE | re.IGNORECASE) - relative_dictionary[pattern] = key - return relative_dictionary