2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
setuptools,
|
|
|
|
python-dateutil,
|
|
|
|
pytz,
|
|
|
|
regex,
|
|
|
|
tzlocal,
|
|
|
|
hijri-converter,
|
|
|
|
convertdate,
|
|
|
|
fasttext,
|
|
|
|
langdetect,
|
|
|
|
parameterized,
|
|
|
|
pytestCheckHook,
|
|
|
|
gitpython,
|
|
|
|
parsel,
|
|
|
|
requests,
|
|
|
|
ruamel-yaml,
|
2020-06-15 15:56:04 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "dateparser";
|
2024-01-02 11:29:13 +00:00
|
|
|
version = "1.2.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "scrapinghub";
|
|
|
|
repo = "dateparser";
|
2023-01-20 10:41:00 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-mnL44hojebOwP6qtEBHs5QM4uRmLuGlVNr+sM3jZEKE=";
|
2021-04-05 15:23:46 +00:00
|
|
|
};
|
2020-06-15 15:56:04 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-11-21 17:40:18 +00:00
|
|
|
python-dateutil
|
|
|
|
pytz
|
|
|
|
regex
|
|
|
|
tzlocal
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
calendars = [
|
|
|
|
hijri-converter
|
|
|
|
convertdate
|
|
|
|
];
|
2022-11-21 17:40:18 +00:00
|
|
|
fasttext = [ fasttext ];
|
|
|
|
langdetect = [ langdetect ];
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-04-05 15:23:46 +00:00
|
|
|
parameterized
|
|
|
|
pytestCheckHook
|
2022-12-17 10:02:37 +00:00
|
|
|
gitpython
|
2022-11-21 17:40:18 +00:00
|
|
|
parsel
|
|
|
|
requests
|
2021-12-06 16:07:01 +00:00
|
|
|
ruamel-yaml
|
2022-11-21 17:40:18 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
|
2021-04-05 15:23:46 +00:00
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME="$TEMPDIR"
|
|
|
|
'';
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
# Upstream only runs the tests in tests/ in CI, others use git clone
|
|
|
|
pytestFlagsArray = [ "tests" ];
|
|
|
|
|
2021-10-08 15:17:17 +00:00
|
|
|
disabledTests = [
|
|
|
|
# access network
|
|
|
|
"test_custom_language_detect_fast_text_0"
|
|
|
|
"test_custom_language_detect_fast_text_1"
|
|
|
|
];
|
|
|
|
|
2021-04-05 15:23:46 +00:00
|
|
|
pythonImportsCheck = [ "dateparser" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-12-02 08:20:57 +00:00
|
|
|
changelog = "https://github.com/scrapinghub/dateparser/blob/${src.rev}/HISTORY.rst";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Date parsing library designed to parse dates from HTML pages";
|
|
|
|
homepage = "https://github.com/scrapinghub/dateparser";
|
|
|
|
license = licenses.bsd3;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "dateparser-download";
|
2021-04-05 15:23:46 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|