2022-06-16 17:23:12 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-08-18 13:19:15 +00:00
|
|
|
, appdirs
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, cachelib
|
2021-08-18 13:19:15 +00:00
|
|
|
, cssselect
|
|
|
|
, fetchFromGitHub
|
2020-09-25 04:45:31 +00:00
|
|
|
, keep
|
2021-08-18 13:19:15 +00:00
|
|
|
, lxml
|
|
|
|
, pygments
|
|
|
|
, pyquery
|
|
|
|
, requests
|
|
|
|
, pytestCheckHook
|
2022-05-18 14:49:53 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "howdoi";
|
2021-10-28 06:52:43 +00:00
|
|
|
version = "2.0.19";
|
2022-05-18 14:49:53 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "gleitz";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2022-05-18 14:49:53 +00:00
|
|
|
hash = "sha256-uLAc6E8+8uPpo070vsG6Od/855N3gTQMf5pSUvtlh0I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-08-18 13:19:15 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
|
|
|
cachelib
|
|
|
|
cssselect
|
|
|
|
keep
|
|
|
|
lxml
|
|
|
|
pygments
|
|
|
|
pyquery
|
|
|
|
requests
|
|
|
|
];
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-08-18 13:19:15 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
2021-08-18 13:19:15 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# AssertionError: "The...
|
|
|
|
"test_get_text_with_one_link"
|
|
|
|
"test_get_text_without_links"
|
2022-05-18 14:49:53 +00:00
|
|
|
# Those tests are failing in the sandbox
|
|
|
|
# OSError: [Errno 24] Too many open files
|
|
|
|
"test_answers"
|
|
|
|
"test_answers_bing"
|
|
|
|
"test_colorize"
|
|
|
|
"test_json_output"
|
|
|
|
"test_missing_pre_or_code_query"
|
|
|
|
"test_multiple_answers"
|
|
|
|
"test_position"
|
|
|
|
"test_unicode_answer"
|
2022-07-14 12:49:19 +00:00
|
|
|
"test_answer_links_using_l_option"
|
2021-08-18 13:19:15 +00:00
|
|
|
];
|
|
|
|
|
2021-10-28 06:52:43 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"howdoi"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2022-06-16 17:23:12 +00:00
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Instant coding answers via the command line";
|
2022-05-18 14:49:53 +00:00
|
|
|
homepage = "https://github.com/gleitz/howdoi";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-08-18 13:19:15 +00:00
|
|
|
maintainers = with maintainers; [ costrouc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|