2021-03-10 14:49:50 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, isPy3k
|
|
|
|
, fetchFromGitHub
|
2021-07-03 13:37:24 +02:00
|
|
|
, python-dateutil
|
2017-12-12 11:33:33 +01:00
|
|
|
, pytz
|
|
|
|
, regex
|
2021-03-10 14:49:50 +01:00
|
|
|
, tzlocal
|
|
|
|
, hijri-converter
|
|
|
|
, convertdate
|
2021-10-06 02:10:41 +02:00
|
|
|
, fasttext
|
|
|
|
, langdetect
|
2021-03-10 14:49:50 +01:00
|
|
|
, parameterized
|
|
|
|
, pytestCheckHook
|
|
|
|
, GitPython
|
2021-11-01 21:59:40 +01:00
|
|
|
, ruamel-yaml
|
2020-06-07 15:36:06 +02:00
|
|
|
}:
|
2018-02-09 17:22:39 +01:00
|
|
|
|
2017-12-12 11:33:33 +01:00
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dateparser";
|
2021-10-06 02:10:41 +02:00
|
|
|
version = "1.1.0";
|
2017-12-12 11:33:33 +01:00
|
|
|
|
2021-03-10 14:30:32 +01:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2021-03-10 14:49:50 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scrapinghub";
|
|
|
|
repo = "dateparser";
|
|
|
|
rev = "v${version}";
|
2021-10-06 02:10:41 +02:00
|
|
|
sha256 = "sha256-RpQWDsj7vGtfu6wf4yETdswfXDfoTkburTl6aOA03Ww=";
|
2017-12-12 11:33:33 +01:00
|
|
|
};
|
|
|
|
|
2018-02-09 17:22:39 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
# install_requires
|
2021-07-03 13:37:24 +02:00
|
|
|
python-dateutil pytz regex tzlocal
|
2018-02-09 17:22:39 +01:00
|
|
|
# extra_requires
|
2021-10-06 02:10:41 +02:00
|
|
|
hijri-converter convertdate fasttext langdetect
|
2018-02-09 17:22:39 +01:00
|
|
|
];
|
2017-12-12 11:33:33 +01:00
|
|
|
|
2021-03-10 14:49:50 +01:00
|
|
|
checkInputs = [
|
|
|
|
parameterized
|
|
|
|
pytestCheckHook
|
|
|
|
GitPython
|
2021-11-01 21:59:40 +01:00
|
|
|
ruamel-yaml
|
2021-03-10 14:49:50 +01:00
|
|
|
];
|
|
|
|
|
2021-10-06 02:10:41 +02:00
|
|
|
preCheck = ''
|
|
|
|
export HOME="$TEMPDIR"
|
|
|
|
'';
|
|
|
|
|
2021-03-10 14:49:50 +01:00
|
|
|
# Upstream only runs the tests in tests/ in CI, others use git clone
|
|
|
|
pytestFlagsArray = [ "tests" ];
|
|
|
|
|
2021-10-06 02:10:41 +02:00
|
|
|
disabledTests = [
|
|
|
|
# access network
|
|
|
|
"test_custom_language_detect_fast_text_0"
|
|
|
|
"test_custom_language_detect_fast_text_1"
|
|
|
|
];
|
|
|
|
|
2021-03-10 14:49:50 +01:00
|
|
|
pythonImportsCheck = [ "dateparser" ];
|
|
|
|
|
2018-02-09 17:22:39 +01:00
|
|
|
meta = with lib; {
|
2017-12-12 11:33:33 +01:00
|
|
|
description = "Date parsing library designed to parse dates from HTML pages";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://github.com/scrapinghub/dateparser";
|
2017-12-12 11:33:33 +01:00
|
|
|
license = licenses.bsd3;
|
2021-03-10 14:49:50 +01:00
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2017-12-12 11:33:33 +01:00
|
|
|
};
|
|
|
|
}
|