ansible-later: 2.0.22 -> 2.0.23
[NixPkgs.git] / pkgs / development / python-modules / dateparser / default.nix
blob79a45bdb3575cfcdb7af114ece7df434542464d5
1 { lib
2 , buildPythonPackage
3 , isPy3k
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 , ruamel-yaml
20 buildPythonPackage rec {
21   pname = "dateparser";
22   version = "1.1.1";
24   disabled = !isPy3k;
26   src = fetchFromGitHub {
27     owner = "scrapinghub";
28     repo = "dateparser";
29     rev = "v${version}";
30     sha256 = "sha256-bDup3q93Zq+pvwsy/lQy2byOMjG6C/+7813hWQMbZRU=";
31   };
33   patches = [
34     ./regex-compat.patch
35     (fetchpatch {
36       name = "tests-31st.patch";
37       url = "https://github.com/scrapinghub/dateparser/commit/b132381b9c15e560a0be5183c7d96180119a7b4f.diff";
38       sha256 = "nQUWtfku5sxx/C45KJnfwvDXiccXGeVM+cQDKX9lxbE=";
39     })
40   ];
42   postPatch = ''
43     substituteInPlace setup.py --replace \
44       'regex !=2019.02.19,!=2021.8.27,<2022.3.15' \
45       'regex'
46   '';
48   propagatedBuildInputs = [
49     # install_requires
50     python-dateutil pytz regex tzlocal
51     # extra_requires
52     hijri-converter convertdate fasttext langdetect
53   ];
55   checkInputs = [
56     parameterized
57     pytestCheckHook
58     GitPython
59     ruamel-yaml
60   ];
62   preCheck = ''
63     export HOME="$TEMPDIR"
64   '';
66   # Upstream only runs the tests in tests/ in CI, others use git clone
67   pytestFlagsArray = [ "tests" ];
69   disabledTests = [
70     # access network
71     "test_custom_language_detect_fast_text_0"
72     "test_custom_language_detect_fast_text_1"
73   ];
75   pythonImportsCheck = [ "dateparser" ];
77   meta = with lib; {
78     description = "Date parsing library designed to parse dates from HTML pages";
79     homepage = "https://github.com/scrapinghub/dateparser";
80     license = licenses.bsd3;
81     maintainers = with maintainers; [ dotlambda ];
82   };