diff options
author | figsoda <figsoda@pm.me> | 2021-09-28 21:52:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-28 21:52:53 -0400 |
commit | 8a587c79f6c970059b98a9e30e10bb33674b6340 (patch) | |
tree | 90275b2020fbe4ba5ae3a67a37ebd6b8535958bd /pkgs/tools | |
parent | 37b260a02db61f184e6241ae1da2af726dba4f18 (diff) | |
parent | d3a174415c83f3d020ffc3d98d5827657c0e1cbb (diff) |
Merge pull request #139618 from fabaff/bump-httpie
httpie: 2.4.0 -> 2.5.0
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/networking/httpie/default.nix | 99 |
1 files changed, 39 insertions, 60 deletions
diff --git a/pkgs/tools/networking/httpie/default.nix b/pkgs/tools/networking/httpie/default.nix index a7ecabe8e6275..e81706a343593 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"; |