summary refs log tree commit diff
path: root/pkgs/tools/networking/httpie/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/networking/httpie/default.nix')
-rw-r--r--pkgs/tools/networking/httpie/default.nix32
1 files changed, 25 insertions, 7 deletions
diff --git a/pkgs/tools/networking/httpie/default.nix b/pkgs/tools/networking/httpie/default.nix
index 6395fcf09eb..4230762d946 100644
--- a/pkgs/tools/networking/httpie/default.nix
+++ b/pkgs/tools/networking/httpie/default.nix
@@ -1,17 +1,35 @@
-{ stdenv, fetchurl, pythonPackages }:
+{ stdenv, fetchFromGitHub, python3Packages, docutils, }:
 
-pythonPackages.buildPythonApplication rec {
+python3Packages.buildPythonApplication rec {
   pname = "httpie";
   version = "1.0.3";
 
-  src = pythonPackages.fetchPypi {
-    inherit pname version;
-    sha256 = "103fcigpxf4nqmrdqjnyz7d9n4n16906slwmmqqc0gkxv8hnw6vd";
+  src = fetchFromGitHub {
+    owner = "jakubroztocil";
+    repo = "httpie";
+    rev = version;
+    sha256 = "0y30sp0x3nmgzi4dqw1rc3705hnn36ij0zlyyx7g6fqdq8bd8p5q";
   };
 
-  propagatedBuildInputs = with pythonPackages; [ pygments requests ];
+  propagatedBuildInputs = with python3Packages; [ pygments requests setuptools ];
+  dontUseSetuptoolsCheck = true;
 
-  doCheck = false;
+  disabledTests = [
+    "test_current_version"
+    "test_error"
+  ];
+
+  checkInputs = with python3Packages; [
+    mock
+    pytest
+    pytest-httpbin
+    pytestCheckHook
+  ];
+
+  # the tests call rst2pseudoxml.py from docutils
+  preCheck = ''
+    export PATH=${docutils}/bin:$PATH
+  '';
 
   meta = {
     description = "A command line HTTP client whose goal is to make CLI human-friendly";