Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / dateparser / default.nix
blob3f6bfdf86d6af296517a21bfe19e3ea27b64de90
1 { lib
2 , buildPythonPackage
3 , pythonOlder
4 , fetchFromGitHub
5 , fetchpatch
6 , python-dateutil
7 , pytz
8 , regex
9 , tzlocal
10 , hijri-converter
11 , convertdate
12 , fasttext
13 , langdetect
14 , parameterized
15 , pytestCheckHook
16 , gitpython
17 , parsel
18 , requests
19 , ruamel-yaml
22 buildPythonPackage rec {
23   pname = "dateparser";
24   version = "1.1.8";
26   disabled = pythonOlder "3.7";
28   format = "setuptools";
30   src = fetchFromGitHub {
31     owner = "scrapinghub";
32     repo = "dateparser";
33     rev = "refs/tags/v${version}";
34     hash = "sha256-52g8defF5bsisBv2QoyUymXcf0sljOI9PjeR4l0Pw6k=";
35   };
37   propagatedBuildInputs = [
38     python-dateutil
39     pytz
40     regex
41     tzlocal
42   ];
44   passthru.optional-dependencies = {
45     calendars = [ hijri-converter convertdate ];
46     fasttext = [ fasttext ];
47     langdetect = [ langdetect ];
48   };
50   nativeCheckInputs = [
51     parameterized
52     pytestCheckHook
53     gitpython
54     parsel
55     requests
56     ruamel-yaml
57   ] ++ lib.flatten (lib.attrValues passthru.optional-dependencies);
59   preCheck = ''
60     export HOME="$TEMPDIR"
61   '';
63   # Upstream only runs the tests in tests/ in CI, others use git clone
64   pytestFlagsArray = [ "tests" ];
66   disabledTests = [
67     # access network
68     "test_custom_language_detect_fast_text_0"
69     "test_custom_language_detect_fast_text_1"
70   ];
72   pythonImportsCheck = [ "dateparser" ];
74   meta = with lib; {
75     changelog = "https://github.com/scrapinghub/dateparser/blob/${src.rev}/HISTORY.rst";
76     description = "Date parsing library designed to parse dates from HTML pages";
77     homepage = "https://github.com/scrapinghub/dateparser";
78     license = licenses.bsd3;
79     maintainers = with maintainers; [ dotlambda ];
80   };