1{ stdenv
2, lib
3, appdirs
4, buildPythonPackage
5, cachelib
6, cssselect
7, fetchFromGitHub
8, keep
9, lxml
10, pygments
11, pyquery
12, requests
13, pytestCheckHook
14, pythonOlder
15}:
16
17buildPythonPackage rec {
18 pname = "howdoi";
19 version = "2.0.19";
20 format = "setuptools";
21
22 disabled = pythonOlder "3.7";
23
24 src = fetchFromGitHub {
25 owner = "gleitz";
26 repo = pname;
27 rev = "v${version}";
28 hash = "sha256-uLAc6E8+8uPpo070vsG6Od/855N3gTQMf5pSUvtlh0I=";
29 };
30
31 propagatedBuildInputs = [
32 appdirs
33 cachelib
34 cssselect
35 keep
36 lxml
37 pygments
38 pyquery
39 requests
40 ];
41
42 checkInputs = [
43 pytestCheckHook
44 ];
45
46 preCheck = ''
47 export HOME=$(mktemp -d)
48 '';
49
50 disabledTests = [
51 # AssertionError: "The...
52 "test_get_text_with_one_link"
53 "test_get_text_without_links"
54 # Those tests are failing in the sandbox
55 # OSError: [Errno 24] Too many open files
56 "test_answers"
57 "test_answers_bing"
58 "test_colorize"
59 "test_json_output"
60 "test_missing_pre_or_code_query"
61 "test_multiple_answers"
62 "test_position"
63 "test_unicode_answer"
64 "test_answer_links_using_l_option"
65 ];
66
67 pythonImportsCheck = [
68 "howdoi"
69 ];
70
71 meta = with lib; {
72 broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
73 description = "Instant coding answers via the command line";
74 homepage = "https://github.com/gleitz/howdoi";
75 license = licenses.mit;
76 maintainers = with maintainers; [ costrouc ];
77 };
78}