1{ lib
2, stdenv
3, buildPythonPackage
4, fetchFromGitHub
5, installShellFiles
6, pandoc
7, pythonOlder
8# BuildInputs
9, charset-normalizer
10, defusedxml
11, multidict
12, pygments
13, requests
14, requests-toolbelt
15, setuptools
16, rich
17, pysocks
18# CheckInputs
19, pytest-httpbin
20, pytest-lazy-fixture
21, pytest-mock
22, pytestCheckHook
23, responses
24, werkzeug
25}:
26
27buildPythonPackage rec {
28 pname = "httpie";
29 version = "3.2.2";
30 format = "setuptools";
31
32 src = fetchFromGitHub {
33 owner = "httpie";
34 repo = "httpie";
35 rev = version;
36 hash = "sha256-hPsjEpvT6tnPm68AUB2Tv3Gon4DfSzO2VYCGqP8ozSI=";
37 };
38
39 nativeBuildInputs = [
40 installShellFiles
41 pandoc
42 ];
43
44 propagatedBuildInputs = [
45 charset-normalizer
46 defusedxml
47 multidict
48 pygments
49 requests
50 requests-toolbelt
51 setuptools
52 rich
53 ] ++ requests.optional-dependencies.socks;
54
55
56 nativeCheckInputs = [
57 pytest-httpbin
58 pytest-lazy-fixture
59 pytest-mock
60 pytestCheckHook
61 responses
62 werkzeug
63 ];
64
65 postInstall = ''
66 # install completions
67 installShellCompletion --cmd http \
68 --bash extras/httpie-completion.bash \
69 --fish extras/httpie-completion.fish
70
71 # convert the docs/README.md file
72 pandoc --standalone -f markdown -t man docs/README.md -o docs/http.1
73 installManPage docs/http.1
74 '';
75
76 pytestFlagsArray = [
77 "httpie"
78 "tests"
79 ];
80
81 pythonImportsCheck = [
82 "httpie"
83 ];
84
85 disabledTestPaths = lib.optionals stdenv.isDarwin [
86 # flaky
87 "tests/test_plugins_cli.py"
88 ];
89
90 disabledTests = [
91 # flaky
92 "test_stdin_read_warning"
93 # Re-evaluate those tests with the next release
94 "test_duplicate_keys_support_from_response"
95 "test_invalid_xml"
96 "test_json_formatter_with_body_preceded_by_non_json_data"
97 "test_pretty_options_with_and_without_stream_with_converter"
98 "test_response_mime_overwrite"
99 "test_terminal_output_response_charset_detection"
100 "test_terminal_output_response_charset_override"
101 "test_terminal_output_response_content_type_charset_with_stream"
102 "test_terminal_output_response_content_type_charset"
103 "test_valid_xml"
104 "test_xml_format_options"
105 "test_xml_xhtm"
106 ] ++ lib.optionals stdenv.isDarwin [
107 # flaky
108 "test_daemon_runner"
109 ];
110
111 meta = with lib; {
112 description = "A command line HTTP client whose goal is to make CLI human-friendly";
113 homepage = "https://httpie.org/";
114 changelog = "https://github.com/httpie/httpie/blob/${version}/CHANGELOG.md";
115 license = licenses.bsd3;
116 maintainers = with maintainers; [ antono relrod schneefux ];
117 };
118}