From c004f77a941fd92f60b130ffba0de7117e6d143c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20F=C3=B8llesdal?= Date: Thu, 12 May 2022 09:27:25 +0200 Subject: [PATCH 1/4] httpie: 3.1.0 -> 3.2.1 --- pkgs/tools/networking/httpie/default.nix | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/pkgs/tools/networking/httpie/default.nix b/pkgs/tools/networking/httpie/default.nix index a6c6ddfe5bb..8590c85d2f3 100644 --- a/pkgs/tools/networking/httpie/default.nix +++ b/pkgs/tools/networking/httpie/default.nix @@ -7,14 +7,14 @@ python3.pkgs.buildPythonApplication 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 = [ @@ -30,15 +30,18 @@ python3.pkgs.buildPythonApplication rec { requests requests-toolbelt setuptools + rich + pysocks ]; checkInputs = with python3.pkgs; [ - mock pytest pytest-httpbin pytest-lazy-fixture + pytest-mock pytestCheckHook responses + werkzeug ]; postInstall = '' @@ -58,15 +61,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" ]; From bfeb72c912c86401520bad787b0ff1d329b37642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20F=C3=B8llesdal?= Date: Thu, 12 May 2022 09:38:51 +0200 Subject: [PATCH 2/4] httpie: Remove unused patch --- pkgs/tools/networking/httpie/strip-venv.patch | 22 ------------------- 1 file changed, 22 deletions(-) delete mode 100644 pkgs/tools/networking/httpie/strip-venv.patch 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( From 6281fca1610cf4ecda47ea6c04887989fbde0098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20F=C3=B8llesdal?= Date: Thu, 12 May 2022 10:36:30 +0200 Subject: [PATCH 3/4] httpie: Make available as python library --- .../python-modules}/httpie/default.nix | 27 +++++++++++++++---- pkgs/top-level/all-packages.nix | 2 +- pkgs/top-level/python-packages.nix | 2 ++ 3 files changed, 25 insertions(+), 6 deletions(-) rename pkgs/{tools/networking => development/python-modules}/httpie/default.nix (79%) diff --git a/pkgs/tools/networking/httpie/default.nix b/pkgs/development/python-modules/httpie/default.nix similarity index 79% rename from pkgs/tools/networking/httpie/default.nix rename to pkgs/development/python-modules/httpie/default.nix index 8590c85d2f3..4f852bb3c25 100644 --- a/pkgs/tools/networking/httpie/default.nix +++ b/pkgs/development/python-modules/httpie/default.nix @@ -1,11 +1,29 @@ { 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.2.1"; format = "setuptools"; @@ -22,7 +40,7 @@ python3.pkgs.buildPythonApplication rec { pandoc ]; - propagatedBuildInputs = with python3.pkgs; [ + propagatedBuildInputs = [ charset-normalizer defusedxml multidict @@ -34,8 +52,7 @@ python3.pkgs.buildPythonApplication rec { pysocks ]; - checkInputs = with python3.pkgs; [ - pytest + checkInputs = [ pytest-httpbin pytest-lazy-fixture pytest-mock diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e89aa5c04a8..3e8eafbe82c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6966,7 +6966,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 44f7328c6f9..58e40073c70 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3935,6 +3935,8 @@ in { httpcore = callPackage ../development/python-modules/httpcore { }; + httpie = callPackage ../development/python-modules/httpie { }; + http-ece = callPackage ../development/python-modules/http-ece { }; httplib2 = callPackage ../development/python-modules/httplib2 { }; From 8f9fd7c7757c7e3d0728f0700b95df41ff050bf9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristoffer=20F=C3=B8llesdal?= Date: Tue, 19 Apr 2022 11:11:14 +0200 Subject: [PATCH 4/4] python3Packages.httpie-ntlm: init at 1.0.2 --- .../python-modules/httpie-ntlm/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 33 insertions(+) create mode 100644 pkgs/development/python-modules/httpie-ntlm/default.nix 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/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 58e40073c70..fdb372765e9 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -3939,6 +3939,8 @@ in { 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 { };