nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 appdirs,
4 buildPythonPackage,
5 cachelib,
6 colorama,
7 cssselect,
8 fetchFromGitHub,
9 fetchpatch,
10 keep,
11 lxml,
12 pygments,
13 pyquery,
14 requests,
15 rich,
16 pytestCheckHook,
17 setuptools,
18}:
19
20buildPythonPackage rec {
21 pname = "howdoi";
22 version = "2.0.20";
23 pyproject = true;
24
25 src = fetchFromGitHub {
26 owner = "gleitz";
27 repo = "howdoi";
28 tag = "v${version}";
29 hash = "sha256-u0k+h7Sp2t/JUnfPqRzDpEA+vNXB7CpyZ/SRvk+B9t0=";
30 };
31
32 patches = [
33 # Bad test case fix: comparing hardcoded string to internet search result
34 # PR merged: https://github.com/gleitz/howdoi/pull/497
35 # Please remove on the next release
36 (fetchpatch {
37 url = "https://github.com/gleitz/howdoi/commit/7d24e9e1c87811a6e66d60f504381383cf1ac3fd.patch";
38 hash = "sha256-AFQMnMEijaExqiimbNaVeIRmZJ4Yj0nGUOEjfsvBLh8=";
39 })
40 ];
41
42 build-system = [ setuptools ];
43
44 dependencies = [
45 appdirs
46 cachelib
47 colorama
48 cssselect
49 keep
50 lxml
51 pygments
52 pyquery
53 requests
54 rich
55 ];
56
57 nativeCheckInputs = [ pytestCheckHook ];
58
59 preCheck = ''
60 export HOME=$(mktemp -d)
61 '';
62
63 disabledTests = [
64 "test_colorize"
65 # Tests are flaky, OSError: [Errno 24] Too many open files happens
66 "test_answer_links_using_l_option"
67 "test_answers_bing"
68 "test_answers"
69 "test_json_output"
70 "test_missing_pre_or_code_query"
71 "test_multiple_answers"
72 "test_position"
73 "test_unicode_answer"
74 ];
75
76 pythonImportsCheck = [ "howdoi" ];
77
78 meta = {
79 description = "Instant coding answers via the command line";
80 homepage = "https://github.com/gleitz/howdoi";
81 changelog = "https://github.com/gleitz/howdoi/blob/v${version}/CHANGES.txt";
82 license = lib.licenses.mit;
83 maintainers = [ ];
84 };
85}