2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
appdirs,
|
|
|
|
buildPythonPackage,
|
|
|
|
cachelib,
|
|
|
|
colorama,
|
|
|
|
cssselect,
|
|
|
|
fetchFromGitHub,
|
2024-09-19 14:19:46 +00:00
|
|
|
fetchpatch,
|
2024-06-05 15:53:02 +00:00
|
|
|
keep,
|
|
|
|
lxml,
|
|
|
|
pygments,
|
|
|
|
pyquery,
|
|
|
|
requests,
|
|
|
|
rich,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
2024-09-19 14:19:46 +00:00
|
|
|
setuptools,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "howdoi";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "2.0.20";
|
2024-09-19 14:19:46 +00:00
|
|
|
pyproject = true;
|
2022-05-18 14:49:53 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gleitz";
|
2024-09-19 14:19:46 +00:00
|
|
|
repo = "howdoi";
|
|
|
|
rev = "refs/tags/v${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-u0k+h7Sp2t/JUnfPqRzDpEA+vNXB7CpyZ/SRvk+B9t0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
patches = [
|
|
|
|
# Bad test case fix: comparing hardcoded string to internet search result
|
|
|
|
# PR merged: https://github.com/gleitz/howdoi/pull/497
|
|
|
|
# Please remove on the next release
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/gleitz/howdoi/commit/7d24e9e1c87811a6e66d60f504381383cf1ac3fd.patch";
|
|
|
|
hash = "sha256-AFQMnMEijaExqiimbNaVeIRmZJ4Yj0nGUOEjfsvBLh8=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
build-system = [ setuptools ];
|
|
|
|
|
|
|
|
dependencies = [
|
2021-08-18 13:19:15 +00:00
|
|
|
appdirs
|
|
|
|
cachelib
|
2023-07-15 17:15:38 +00:00
|
|
|
colorama
|
2021-08-18 13:19:15 +00:00
|
|
|
cssselect
|
|
|
|
keep
|
|
|
|
lxml
|
|
|
|
pygments
|
|
|
|
pyquery
|
|
|
|
requests
|
2023-07-15 17:15:38 +00:00
|
|
|
rich
|
2021-08-18 13:19:15 +00:00
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
2021-08-18 13:19:15 +00:00
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_colorize"
|
|
|
|
# Tests are flaky, OSError: [Errno 24] Too many open files happpens
|
|
|
|
"test_answer_links_using_l_option"
|
|
|
|
"test_answers_bing"
|
|
|
|
"test_answers"
|
|
|
|
"test_json_output"
|
|
|
|
"test_missing_pre_or_code_query"
|
|
|
|
"test_multiple_answers"
|
|
|
|
"test_position"
|
|
|
|
"test_unicode_answer"
|
|
|
|
];
|
2021-08-18 13:19:15 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "howdoi" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Instant coding answers via the command line";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://github.com/gleitz/howdoi";
|
2024-09-19 14:19:46 +00:00
|
|
|
changelog = "https://github.com/gleitz/howdoi/blob/v${version}/CHANGES.txt";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|