summary refs log tree commit diff
path: root/pkgs/tools/networking/httpie/default.nix
blob: a6c6ddfe5bba9accc342d6871a0b6ff02fa97cfa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ lib
, fetchFromGitHub
, installShellFiles
, python3
, pandoc
}:

python3.pkgs.buildPythonApplication rec {
  pname = "httpie";
  version = "3.1.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "httpie";
    repo = "httpie";
    rev = version;
    hash = "sha256-x7Zucb2i8D4Xbn77eBzSxOAcc2fGg5MFKFiyJhytQ0s=";
  };

  nativeBuildInputs = [
    installShellFiles
    pandoc
  ];

  propagatedBuildInputs = with python3.pkgs; [
    charset-normalizer
    defusedxml
    multidict
    pygments
    requests
    requests-toolbelt
    setuptools
  ];

  checkInputs = with python3.pkgs; [
    mock
    pytest
    pytest-httpbin
    pytest-lazy-fixture
    pytestCheckHook
    responses
  ];

  postInstall = ''
    # install completions
    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
  '';

  pytestFlagsArray = [
    "httpie"
    "tests"
  ];

  disabledTests = [
    "test_chunked"
    "test_verbose_chunked"
    "test_multipart_chunked"
    "test_request_body_from_file_by_path_chunked"
    # Part of doctest
    "httpie.encoding.detect_encoding"
  ];

  pythonImportsCheck = [
    "httpie"
  ];

  meta = with lib; {
    description = "A command line HTTP client whose goal is to make CLI human-friendly";
    homepage = "https://httpie.org/";
    license = licenses.bsd3;
    maintainers = with maintainers; [ antono relrod schneefux SuperSandro2000 ];
  };
}