2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
installShellFiles,
|
|
|
|
pandoc,
|
|
|
|
# BuildInputs
|
|
|
|
charset-normalizer,
|
|
|
|
defusedxml,
|
|
|
|
multidict,
|
|
|
|
pygments,
|
|
|
|
requests,
|
|
|
|
requests-toolbelt,
|
|
|
|
setuptools,
|
|
|
|
rich,
|
|
|
|
pysocks,
|
|
|
|
pip,
|
|
|
|
pytest-httpbin,
|
|
|
|
pytest-lazy-fixture,
|
|
|
|
pytest-mock,
|
|
|
|
pytestCheckHook,
|
|
|
|
responses,
|
|
|
|
werkzeug,
|
2021-10-01 09:20:50 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "httpie";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "3.2.2";
|
2022-03-30 09:31:56 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-02-13 14:23:35 +00:00
|
|
|
owner = "httpie";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "httpie";
|
|
|
|
rev = version;
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-hPsjEpvT6tnPm68AUB2Tv3Gon4DfSzO2VYCGqP8ozSI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
pandoc
|
2020-07-18 16:06:22 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
propagatedBuildInputs = [
|
2021-10-17 09:34:42 +00:00
|
|
|
charset-normalizer
|
2021-10-01 09:20:50 +00:00
|
|
|
defusedxml
|
2022-02-10 20:34:41 +00:00
|
|
|
multidict
|
2021-10-01 09:20:50 +00:00
|
|
|
pygments
|
|
|
|
requests
|
|
|
|
requests-toolbelt
|
|
|
|
setuptools
|
2022-05-18 14:49:53 +00:00
|
|
|
rich
|
2022-12-28 21:21:41 +00:00
|
|
|
] ++ requests.optional-dependencies.socks;
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
pip
|
2020-04-24 23:36:52 +00:00
|
|
|
pytest-httpbin
|
2022-03-30 09:31:56 +00:00
|
|
|
pytest-lazy-fixture
|
2022-05-18 14:49:53 +00:00
|
|
|
pytest-mock
|
2020-04-24 23:36:52 +00:00
|
|
|
pytestCheckHook
|
2021-10-01 09:20:50 +00:00
|
|
|
responses
|
2022-05-18 14:49:53 +00:00
|
|
|
werkzeug
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# install completions
|
2022-12-28 21:21:41 +00:00
|
|
|
installShellCompletion --cmd http \
|
|
|
|
--bash extras/httpie-completion.bash \
|
|
|
|
--fish extras/httpie-completion.fish
|
2021-10-01 09:20:50 +00:00
|
|
|
|
|
|
|
# convert the docs/README.md file
|
|
|
|
pandoc --standalone -f markdown -t man docs/README.md -o docs/http.1
|
|
|
|
installManPage docs/http.1
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-10-01 09:20:50 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"httpie"
|
|
|
|
"tests"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "httpie" ];
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
disabledTestPaths = lib.optionals stdenv.isDarwin [
|
|
|
|
# flaky
|
|
|
|
"tests/test_plugins_cli.py"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
disabledTests =
|
|
|
|
[
|
|
|
|
# flaky
|
|
|
|
"test_stdin_read_warning"
|
|
|
|
# Re-evaluate those tests with the next release
|
|
|
|
"test_duplicate_keys_support_from_response"
|
|
|
|
"test_invalid_xml"
|
|
|
|
"test_json_formatter_with_body_preceded_by_non_json_data"
|
|
|
|
"test_pretty_options_with_and_without_stream_with_converter"
|
|
|
|
"test_response_mime_overwrite"
|
|
|
|
"test_terminal_output_response_charset_detection"
|
|
|
|
"test_terminal_output_response_charset_override"
|
|
|
|
"test_terminal_output_response_content_type_charset_with_stream"
|
|
|
|
"test_terminal_output_response_content_type_charset"
|
|
|
|
"test_valid_xml"
|
|
|
|
"test_xml_format_options"
|
|
|
|
"test_xml_xhtm"
|
|
|
|
# httpbin compatibility issues
|
|
|
|
"test_compress_form"
|
|
|
|
"test_binary_suppresses_when_terminal"
|
|
|
|
"test_binary_suppresses_when_not_terminal_but_pretty"
|
|
|
|
"test_binary_included_and_correct_when_suitable"
|
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
# flaky
|
|
|
|
"test_daemon_runner"
|
|
|
|
];
|
2022-05-18 14:49:53 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Command line HTTP client whose goal is to make CLI human-friendly";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://httpie.org/";
|
2022-12-28 21:21:41 +00:00
|
|
|
changelog = "https://github.com/httpie/httpie/blob/${version}/CHANGELOG.md";
|
2021-02-13 14:23:35 +00:00
|
|
|
license = licenses.bsd3;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
antono
|
|
|
|
relrod
|
|
|
|
schneefux
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|