2021-09-27 12:40:29 +02:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, installShellFiles
|
2022-03-16 10:12:26 +01:00
|
|
|
, python3
|
2021-09-27 12:40:29 +02:00
|
|
|
, pandoc
|
|
|
|
}:
|
2012-12-28 23:28:34 +01:00
|
|
|
|
2022-03-16 10:12:26 +01:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2019-08-30 05:02:24 +02:00
|
|
|
pname = "httpie";
|
2022-03-16 10:12:26 +01:00
|
|
|
version = "3.1.0";
|
|
|
|
format = "setuptools";
|
2012-12-28 23:28:34 +01:00
|
|
|
|
2019-09-23 16:56:01 +02:00
|
|
|
src = fetchFromGitHub {
|
2021-02-08 11:34:19 +01:00
|
|
|
owner = "httpie";
|
2019-09-23 16:56:01 +02:00
|
|
|
repo = "httpie";
|
|
|
|
rev = version;
|
2022-03-16 10:12:26 +01:00
|
|
|
hash = "sha256-x7Zucb2i8D4Xbn77eBzSxOAcc2fGg5MFKFiyJhytQ0s=";
|
2012-12-28 23:28:34 +01:00
|
|
|
};
|
|
|
|
|
2021-09-27 12:40:29 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
installShellFiles
|
|
|
|
pandoc
|
2020-06-22 11:26:36 +02:00
|
|
|
];
|
2019-09-23 16:56:01 +02:00
|
|
|
|
2022-03-16 10:12:26 +01:00
|
|
|
propagatedBuildInputs = with python3.pkgs; [
|
2021-10-19 11:21:23 +02:00
|
|
|
charset-normalizer
|
2021-09-27 12:40:29 +02:00
|
|
|
defusedxml
|
2022-01-24 10:02:44 +01:00
|
|
|
multidict
|
2021-09-27 12:40:29 +02:00
|
|
|
pygments
|
|
|
|
requests
|
|
|
|
requests-toolbelt
|
|
|
|
setuptools
|
|
|
|
];
|
2021-02-08 11:34:19 +01:00
|
|
|
|
2022-03-16 10:12:26 +01:00
|
|
|
checkInputs = with python3.pkgs; [
|
2019-09-23 16:56:01 +02:00
|
|
|
mock
|
|
|
|
pytest
|
|
|
|
pytest-httpbin
|
2022-03-16 10:12:26 +01:00
|
|
|
pytest-lazy-fixture
|
2019-09-23 16:56:01 +02:00
|
|
|
pytestCheckHook
|
2021-09-27 12:40:29 +02:00
|
|
|
responses
|
2019-09-23 16:56:01 +02:00
|
|
|
];
|
|
|
|
|
2020-03-02 00:44:35 +01:00
|
|
|
postInstall = ''
|
2020-03-02 01:16:54 +01:00
|
|
|
# install completions
|
2021-09-27 12:40:29 +02:00
|
|
|
installShellCompletion --bash \
|
|
|
|
--name http.bash extras/httpie-completion.bash
|
|
|
|
installShellCompletion --fish \
|
|
|
|
--name http.fish extras/httpie-completion.fish
|
|
|
|
|
|
|
|
# convert the docs/README.md file
|
|
|
|
pandoc --standalone -f markdown -t man docs/README.md -o docs/http.1
|
|
|
|
installManPage docs/http.1
|
2020-03-02 00:44:35 +01:00
|
|
|
'';
|
|
|
|
|
2021-09-27 12:40:29 +02:00
|
|
|
pytestFlagsArray = [
|
|
|
|
"httpie"
|
|
|
|
"tests"
|
|
|
|
];
|
2012-12-28 23:28:34 +01:00
|
|
|
|
2021-09-27 12:40:29 +02:00
|
|
|
disabledTests = [
|
|
|
|
"test_chunked"
|
|
|
|
"test_verbose_chunked"
|
|
|
|
"test_multipart_chunked"
|
|
|
|
"test_request_body_from_file_by_path_chunked"
|
2021-10-19 11:21:23 +02:00
|
|
|
# Part of doctest
|
|
|
|
"httpie.encoding.detect_encoding"
|
2021-09-27 12:40:29 +02:00
|
|
|
];
|
|
|
|
|
2022-03-16 10:12:26 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"httpie"
|
|
|
|
];
|
2021-02-08 11:34:19 +01:00
|
|
|
|
|
|
|
meta = with lib; {
|
2012-12-29 00:09:01 +01:00
|
|
|
description = "A command line HTTP client whose goal is to make CLI human-friendly";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://httpie.org/";
|
2021-02-08 11:34:19 +01:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ antono relrod schneefux SuperSandro2000 ];
|
2012-12-28 23:28:34 +01:00
|
|
|
};
|
|
|
|
}
|