2021-03-10 13:49:50 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-11-27 20:31:56 +00:00
|
|
|
, pythonOlder
|
2021-03-10 13:49:50 +00:00
|
|
|
, fetchFromGitHub
|
2022-10-31 06:37:19 +00:00
|
|
|
, fetchpatch
|
2021-07-03 11:37:24 +00:00
|
|
|
, python-dateutil
|
2017-12-12 10:33:33 +00:00
|
|
|
, pytz
|
|
|
|
, regex
|
2021-03-10 13:49:50 +00:00
|
|
|
, tzlocal
|
|
|
|
, hijri-converter
|
|
|
|
, convertdate
|
2021-10-06 00:10:41 +00:00
|
|
|
, fasttext
|
|
|
|
, langdetect
|
2021-03-10 13:49:50 +00:00
|
|
|
, parameterized
|
|
|
|
, pytestCheckHook
|
2022-12-05 18:35:46 +00:00
|
|
|
, gitpython
|
2022-11-12 02:48:21 +00:00
|
|
|
, parsel
|
|
|
|
, requests
|
2021-11-01 20:59:40 +00:00
|
|
|
, ruamel-yaml
|
2020-06-07 13:36:06 +00:00
|
|
|
}:
|
2018-02-09 16:22:39 +00:00
|
|
|
|
2017-12-12 10:33:33 +00:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dateparser";
|
2023-02-02 20:11:57 +00:00
|
|
|
version = "1.1.7";
|
2017-12-12 10:33:33 +00:00
|
|
|
|
2022-11-27 20:31:56 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
format = "setuptools";
|
2021-03-10 13:30:32 +00:00
|
|
|
|
2021-03-10 13:49:50 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scrapinghub";
|
|
|
|
repo = "dateparser";
|
2022-12-30 19:13:04 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-02-02 20:11:57 +00:00
|
|
|
hash = "sha256-KQCjXuBDBZduNYJITwk1qx7mBp8CJ95ZbFlhrFMkE8w=";
|
2017-12-12 10:33:33 +00:00
|
|
|
};
|
|
|
|
|
2018-02-09 16:22:39 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-11-12 02:48:21 +00:00
|
|
|
python-dateutil
|
|
|
|
pytz
|
|
|
|
regex
|
|
|
|
tzlocal
|
2018-02-09 16:22:39 +00:00
|
|
|
];
|
2017-12-12 10:33:33 +00:00
|
|
|
|
2022-11-12 02:48:21 +00:00
|
|
|
passthru.optional-dependencies = {
|
|
|
|
calendars = [ hijri-converter convertdate ];
|
|
|
|
fasttext = [ fasttext ];
|
|
|
|
langdetect = [ langdetect ];
|
|
|
|
};
|
|
|
|
|
2023-01-21 12:00:00 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-10 13:49:50 +00:00
|
|
|
parameterized
|
|
|
|
pytestCheckHook
|
2022-12-05 18:35:46 +00:00
|
|
|
gitpython
|
2022-11-12 02:48:21 +00:00
|
|
|
parsel
|
|
|
|
requests
|
2021-11-01 20:59:40 +00:00
|
|
|
ruamel-yaml
|
2022-11-12 02:48:21 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
|
2021-03-10 13:49:50 +00:00
|
|
|
|
2021-10-06 00:10:41 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME="$TEMPDIR"
|
|
|
|
'';
|
|
|
|
|
2021-03-10 13:49:50 +00:00
|
|
|
# Upstream only runs the tests in tests/ in CI, others use git clone
|
|
|
|
pytestFlagsArray = [ "tests" ];
|
|
|
|
|
2021-10-06 00:10:41 +00:00
|
|
|
disabledTests = [
|
|
|
|
# access network
|
|
|
|
"test_custom_language_detect_fast_text_0"
|
|
|
|
"test_custom_language_detect_fast_text_1"
|
|
|
|
];
|
|
|
|
|
2021-03-10 13:49:50 +00:00
|
|
|
pythonImportsCheck = [ "dateparser" ];
|
|
|
|
|
2018-02-09 16:22:39 +00:00
|
|
|
meta = with lib; {
|
2022-11-27 20:31:56 +00:00
|
|
|
changelog = "https://github.com/scrapinghub/dateparser/blob/${src.rev}/HISTORY.rst";
|
2017-12-12 10:33:33 +00:00
|
|
|
description = "Date parsing library designed to parse dates from HTML pages";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/scrapinghub/dateparser";
|
2017-12-12 10:33:33 +00:00
|
|
|
license = licenses.bsd3;
|
2021-03-10 13:49:50 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2017-12-12 10:33:33 +00:00
|
|
|
};
|
|
|
|
}
|