1{ lib
2, buildPythonPackage
3, isPy3k
4, fetchFromGitHub
5, python-dateutil
6, pytz
7, regex
8, tzlocal
9, hijri-converter
10, convertdate
11, fasttext
12, langdetect
13, parameterized
14, pytestCheckHook
15, GitPython
16, ruamel-yaml
17}:
18
19buildPythonPackage rec {
20 pname = "dateparser";
21 version = "1.1.0";
22
23 disabled = !isPy3k;
24
25 src = fetchFromGitHub {
26 owner = "scrapinghub";
27 repo = "dateparser";
28 rev = "v${version}";
29 sha256 = "sha256-RpQWDsj7vGtfu6wf4yETdswfXDfoTkburTl6aOA03Ww=";
30 };
31
32 propagatedBuildInputs = [
33 # install_requires
34 python-dateutil pytz regex tzlocal
35 # extra_requires
36 hijri-converter convertdate fasttext langdetect
37 ];
38
39 checkInputs = [
40 parameterized
41 pytestCheckHook
42 GitPython
43 ruamel-yaml
44 ];
45
46 preCheck = ''
47 export HOME="$TEMPDIR"
48 '';
49
50 # Upstream only runs the tests in tests/ in CI, others use git clone
51 pytestFlagsArray = [ "tests" ];
52
53 disabledTests = [
54 # access network
55 "test_custom_language_detect_fast_text_0"
56 "test_custom_language_detect_fast_text_1"
57 ];
58
59 pythonImportsCheck = [ "dateparser" ];
60
61 meta = with lib; {
62 description = "Date parsing library designed to parse dates from HTML pages";
63 homepage = "https://github.com/scrapinghub/dateparser";
64 license = licenses.bsd3;
65 maintainers = with maintainers; [ dotlambda ];
66 };
67}