2021-10-01 09:20:50 +00:00
|
|
|
{ lib
|
2022-05-18 14:49:53 +00:00
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
2021-10-01 09:20:50 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
|
|
|
, pandoc
|
2022-05-18 14:49:53 +00:00
|
|
|
, pythonOlder
|
|
|
|
# BuildInputs
|
|
|
|
, charset-normalizer
|
|
|
|
, defusedxml
|
|
|
|
, multidict
|
|
|
|
, pygments
|
|
|
|
, requests
|
|
|
|
, requests-toolbelt
|
|
|
|
, setuptools
|
|
|
|
, rich
|
|
|
|
, pysocks
|
|
|
|
# CheckInputs
|
|
|
|
, 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";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "3.2.1";
|
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;
|
2022-05-18 14:49:53 +00:00
|
|
|
hash = "sha256-WEe8zSlNckl7bPBi6u8mHQ1/xPw3kE81F8Xr15TchgM=";
|
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;
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
|
2022-05-18 14:49:53 +00:00
|
|
|
checkInputs = [
|
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
|
|
|
|
2022-03-30 09:31:56 +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"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# flaky
|
|
|
|
"test_stdin_read_warning"
|
2022-12-28 21:21:41 +00:00
|
|
|
# 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"
|
2022-05-18 14:49:53 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# flaky
|
|
|
|
"test_daemon_runner"
|
|
|
|
];
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A command line HTTP client whose goal is to make CLI human-friendly";
|
|
|
|
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;
|
2022-12-28 21:21:41 +00:00
|
|
|
maintainers = with maintainers; [ antono relrod schneefux ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|