nixpkgs/pkgs/development/python-modules/dateparser/default.nix

68 lines
1.3 KiB
Nix
Raw Normal View History

2021-03-10 14:49:50 +01:00
{ lib
, buildPythonPackage
, isPy3k
, fetchFromGitHub
, python-dateutil
, pytz
, regex
2021-03-10 14:49:50 +01:00
, tzlocal
, hijri-converter
, convertdate
, fasttext
, langdetect
2021-03-10 14:49:50 +01:00
, parameterized
, pytestCheckHook
, GitPython
, ruamel-yaml
2020-06-07 15:36:06 +02:00
}:
buildPythonPackage rec {
pname = "dateparser";
version = "1.1.0";
disabled = !isPy3k;
2021-03-10 14:49:50 +01:00
src = fetchFromGitHub {
owner = "scrapinghub";
repo = "dateparser";
rev = "v${version}";
sha256 = "sha256-RpQWDsj7vGtfu6wf4yETdswfXDfoTkburTl6aOA03Ww=";
};
propagatedBuildInputs = [
# install_requires
python-dateutil pytz regex tzlocal
# extra_requires
hijri-converter convertdate fasttext langdetect
];
2021-03-10 14:49:50 +01:00
checkInputs = [
parameterized
pytestCheckHook
GitPython
ruamel-yaml
2021-03-10 14:49:50 +01: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" ];
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" ];
meta = with lib; {
description = "Date parsing library designed to parse dates from HTML pages";
homepage = "https://github.com/scrapinghub/dateparser";
license = licenses.bsd3;
2021-03-10 14:49:50 +01:00
maintainers = with maintainers; [ dotlambda ];
};
}