diff --git a/pkgs/development/python-modules/httpie-ntlm/default.nix b/pkgs/development/python-modules/httpie-ntlm/default.nix new file mode 100644 index 00000000000..22a995ebd24 --- /dev/null +++ b/pkgs/development/python-modules/httpie-ntlm/default.nix @@ -0,0 +1,31 @@ +{ lib +, buildPythonPackage +, fetchPypi +, httpie +, requests_ntlm +}: + +buildPythonPackage rec { + pname = "httpie-ntlm"; + version = "1.0.2"; + format = "setuptools"; + + src = fetchPypi { + inherit pname version; + sha256 = "b1f757180c0bd60741ea16cf91fc53d47df402a5c287c4a61a14b335ea0552b3"; + }; + + propagatedBuildInputs = [ httpie requests_ntlm ]; + + # Package have no tests + doCheck = false; + + pythonImportsCheck = [ "httpie_ntlm" ]; + + meta = with lib; { + description = "NTLM auth plugin for HTTPie"; + homepage = "https://github.com/httpie/httpie-ntlm"; + license = licenses.bsdOriginal; + maintainers = with maintainers; [ kfollesdal ]; + }; +} diff --git a/pkgs/tools/networking/httpie/default.nix b/pkgs/development/python-modules/httpie/default.nix similarity index 71% rename from pkgs/tools/networking/httpie/default.nix rename to pkgs/development/python-modules/httpie/default.nix index a6c6ddfe5bb..4f852bb3c25 100644 --- a/pkgs/tools/networking/httpie/default.nix +++ b/pkgs/development/python-modules/httpie/default.nix @@ -1,20 +1,38 @@ { lib +, buildPythonPackage , fetchFromGitHub , installShellFiles -, python3 , pandoc +, pythonOlder +# BuildInputs +, charset-normalizer +, defusedxml +, multidict +, pygments +, requests +, requests-toolbelt +, setuptools +, rich +, pysocks +# CheckInputs +, pytest-httpbin +, pytest-lazy-fixture +, pytest-mock +, pytestCheckHook +, responses +, werkzeug }: -python3.pkgs.buildPythonApplication rec { +buildPythonPackage rec { pname = "httpie"; - version = "3.1.0"; + version = "3.2.1"; format = "setuptools"; src = fetchFromGitHub { owner = "httpie"; repo = "httpie"; rev = version; - hash = "sha256-x7Zucb2i8D4Xbn77eBzSxOAcc2fGg5MFKFiyJhytQ0s="; + hash = "sha256-WEe8zSlNckl7bPBi6u8mHQ1/xPw3kE81F8Xr15TchgM="; }; nativeBuildInputs = [ @@ -22,7 +40,7 @@ python3.pkgs.buildPythonApplication rec { pandoc ]; - propagatedBuildInputs = with python3.pkgs; [ + propagatedBuildInputs = [ charset-normalizer defusedxml multidict @@ -30,15 +48,17 @@ python3.pkgs.buildPythonApplication rec { requests requests-toolbelt setuptools + rich + pysocks ]; - checkInputs = with python3.pkgs; [ - mock - pytest + checkInputs = [ pytest-httpbin pytest-lazy-fixture + pytest-mock pytestCheckHook responses + werkzeug ]; postInstall = '' @@ -58,15 +78,6 @@ python3.pkgs.buildPythonApplication rec { "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" ]; diff --git a/pkgs/tools/networking/httpie/strip-venv.patch b/pkgs/tools/networking/httpie/strip-venv.patch deleted file mode 100644 index 9cfddbfdf78..00000000000 --- a/pkgs/tools/networking/httpie/strip-venv.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/tests/test_docs.py b/tests/test_docs.py -index 340e64d..a6b4dc9 100644 ---- a/tests/test_docs.py -+++ b/tests/test_docs.py -@@ -42,15 +42,10 @@ assert filenames - # HACK: hardcoded paths, venv should be irrelevant, etc. - # TODO: simplify by using the Python API instead of a subprocess - # then we wont’t need the paths. --VENV_BIN = Path(__file__).parent.parent / 'venv/bin' --VENV_PYTHON = VENV_BIN / 'python' --VENV_RST2PSEUDOXML = VENV_BIN / 'rst2pseudoxml.py' -+VENV_PYTHON = 'python' -+VENV_RST2PSEUDOXML = 'rst2pseudoxml.py' - - --@pytest.mark.skipif( -- not VENV_RST2PSEUDOXML.exists(), -- reason='docutils not installed', --) - @pytest.mark.parametrize('filename', filenames) - def test_rst_file_syntax(filename): - p = subprocess.Popen( diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 085ba2328dc..4b7a17a0ffb 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6968,7 +6968,7 @@ with pkgs; httpdump = callPackage ../tools/security/httpdump { }; - httpie = callPackage ../tools/networking/httpie { }; + httpie = with python3Packages; toPythonApplication httpie; httping = callPackage ../tools/networking/httping {}; diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 02c29ecd904..21103870395 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3939,8 +3939,12 @@ in { httpcore = callPackage ../development/python-modules/httpcore { }; + httpie = callPackage ../development/python-modules/httpie { }; + http-ece = callPackage ../development/python-modules/http-ece { }; + httpie-ntlm = callPackage ../development/python-modules/httpie-ntlm { }; + httplib2 = callPackage ../development/python-modules/httplib2 { }; http-message-signatures = callPackage ../development/python-modules/http-message-signatures { };