summary refs log tree commit diff
path: root/pkgs/tools/networking/httpie
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-09-27 12:40:29 +0200
committerFabian Affolter <mail@fabian-affolter.ch>2021-09-27 12:40:29 +0200
commitd3a174415c83f3d020ffc3d98d5827657c0e1cbb (patch)
tree36b432b25da423ed3eba32d3d406bd7ee460b6c3 /pkgs/tools/networking/httpie
parent7b03c7ee60844ecab58d45bd06e2c5f2f8336e64 (diff)
downloadnixpkgs-d3a174415c83f3d020ffc3d98d5827657c0e1cbb.tar
nixpkgs-d3a174415c83f3d020ffc3d98d5827657c0e1cbb.tar.gz
nixpkgs-d3a174415c83f3d020ffc3d98d5827657c0e1cbb.tar.bz2
nixpkgs-d3a174415c83f3d020ffc3d98d5827657c0e1cbb.tar.lz
nixpkgs-d3a174415c83f3d020ffc3d98d5827657c0e1cbb.tar.xz
nixpkgs-d3a174415c83f3d020ffc3d98d5827657c0e1cbb.tar.zst
nixpkgs-d3a174415c83f3d020ffc3d98d5827657c0e1cbb.zip
httpie: 2.4.0 -> 2.5.0
Diffstat (limited to 'pkgs/tools/networking/httpie')
-rw-r--r--pkgs/tools/networking/httpie/default.nix99
1 files changed, 39 insertions, 60 deletions
diff --git a/pkgs/tools/networking/httpie/default.nix b/pkgs/tools/networking/httpie/default.nix
index a7ecabe8e62..e81706a3435 100644
--- a/pkgs/tools/networking/httpie/default.nix
+++ b/pkgs/tools/networking/httpie/default.nix
@@ -1,88 +1,67 @@
-{ lib, fetchFromGitHub, python3Packages, docutils }:
+{ lib
+, fetchFromGitHub
+, installShellFiles
+, python3Packages
+, pandoc
+}:
 
 python3Packages.buildPythonApplication rec {
   pname = "httpie";
-  version = "2.4.0";
+  version = "2.5.0";
 
   src = fetchFromGitHub {
     owner = "httpie";
     repo = "httpie";
     rev = version;
-    sha256 = "00lafjqg9nfnak0nhcr2l2hzzkwn2y6qv0wdkm6r6f69snizy3hf";
+    sha256 = "sha256-GwwZLXf9CH024gKfWsYPnr/oqQcxR/lQIToFRh59B+E=";
   };
 
-  patches = [
-    ./strip-venv.patch
+  nativeBuildInputs = [
+    installShellFiles
+    pandoc
   ];
 
-  outputs = [ "out" "doc" "man" ];
-
-  nativeBuildInputs = [ docutils ];
-
-  propagatedBuildInputs = with python3Packages; [ pygments requests requests-toolbelt setuptools ];
+  propagatedBuildInputs = with python3Packages; [
+    defusedxml
+    pygments
+    requests
+    requests-toolbelt
+    setuptools
+  ];
 
   checkInputs = with python3Packages; [
     mock
     pytest
     pytest-httpbin
     pytestCheckHook
+    responses
   ];
 
   postInstall = ''
     # install completions
-    install -Dm555 \
-      extras/httpie-completion.bash \
-      $out/share/bash-completion/completions/http.bash
-    install -Dm555 \
-      extras/httpie-completion.fish \
-      $out/share/fish/vendor_completions.d/http.fish
-
-    mkdir -p $man/share/man/man1
-
-    docdir=$doc/share/doc/httpie
-    mkdir -p $docdir/html
-
-    cp AUTHORS.rst CHANGELOG.rst CONTRIBUTING.rst $docdir
-
-    # helpfully, the readme has a `no-web` class to exclude
-    # the parts that are not relevant for offline docs
-
-    # this one build link was not marked however
-    sed -e 's/^|build|//g' -i README.rst
-
-    toHtml() {
-      rst2html5 \
-        --strip-elements-with-class=no-web \
-        --title=http \
-        --no-generator \
-        --no-datestamp \
-        --no-source-link \
-        "$1" \
-        "$2"
-    }
-
-    toHtml README.rst $docdir/html/index.html
-    toHtml CHANGELOG.rst $docdir/html/CHANGELOG.html
-    toHtml CONTRIBUTING.rst $docdir/html/CONTRIBUTING.html
-
-    rst2man \
-      --strip-elements-with-class=no-web \
-      --title=http \
-      --no-generator \
-      --no-datestamp \
-      --no-source-link \
-      README.rst \
-      $man/share/man/man1/http.1
+    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
   '';
 
-  # the tests call rst2pseudoxml.py from docutils
-  preCheck = ''
-    export PATH=${docutils}/bin:$PATH
-  '';
+  pytestFlagsArray = [
+    "httpie"
+    "tests"
+  ];
 
-  checkPhase = ''
-    py.test ./httpie ./tests --doctest-modules --verbose ./httpie ./tests -k 'not test_chunked and not test_verbose_chunked and not test_multipart_chunked and not test_request_body_from_file_by_path_chunked'
-  '';
+  disabledTests = [
+    "test_chunked"
+    "test_verbose_chunked"
+    "test_multipart_chunked"
+    "test_request_body_from_file_by_path_chunked"
+  ];
+
+  pythonImportsCheck = [ "httpie" ];
 
   meta = with lib; {
     description = "A command line HTTP client whose goal is to make CLI human-friendly";