mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 02:13:23 +00:00
Merge pull request #139618 from fabaff/bump-httpie
httpie: 2.4.0 -> 2.5.0
This commit is contained in:
commit
8a587c79f6
@ -1,88 +1,67 @@
|
|||||||
{ lib, fetchFromGitHub, python3Packages, docutils }:
|
{ lib
|
||||||
|
, fetchFromGitHub
|
||||||
|
, installShellFiles
|
||||||
|
, python3Packages
|
||||||
|
, pandoc
|
||||||
|
}:
|
||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "httpie";
|
pname = "httpie";
|
||||||
version = "2.4.0";
|
version = "2.5.0";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "httpie";
|
owner = "httpie";
|
||||||
repo = "httpie";
|
repo = "httpie";
|
||||||
rev = version;
|
rev = version;
|
||||||
sha256 = "00lafjqg9nfnak0nhcr2l2hzzkwn2y6qv0wdkm6r6f69snizy3hf";
|
sha256 = "sha256-GwwZLXf9CH024gKfWsYPnr/oqQcxR/lQIToFRh59B+E=";
|
||||||
};
|
};
|
||||||
|
|
||||||
patches = [
|
nativeBuildInputs = [
|
||||||
./strip-venv.patch
|
installShellFiles
|
||||||
|
pandoc
|
||||||
];
|
];
|
||||||
|
|
||||||
outputs = [ "out" "doc" "man" ];
|
propagatedBuildInputs = with python3Packages; [
|
||||||
|
defusedxml
|
||||||
nativeBuildInputs = [ docutils ];
|
pygments
|
||||||
|
requests
|
||||||
propagatedBuildInputs = with python3Packages; [ pygments requests requests-toolbelt setuptools ];
|
requests-toolbelt
|
||||||
|
setuptools
|
||||||
|
];
|
||||||
|
|
||||||
checkInputs = with python3Packages; [
|
checkInputs = with python3Packages; [
|
||||||
mock
|
mock
|
||||||
pytest
|
pytest
|
||||||
pytest-httpbin
|
pytest-httpbin
|
||||||
pytestCheckHook
|
pytestCheckHook
|
||||||
|
responses
|
||||||
];
|
];
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
# install completions
|
# install completions
|
||||||
install -Dm555 \
|
installShellCompletion --bash \
|
||||||
extras/httpie-completion.bash \
|
--name http.bash extras/httpie-completion.bash
|
||||||
$out/share/bash-completion/completions/http.bash
|
installShellCompletion --fish \
|
||||||
install -Dm555 \
|
--name http.fish extras/httpie-completion.fish
|
||||||
extras/httpie-completion.fish \
|
|
||||||
$out/share/fish/vendor_completions.d/http.fish
|
|
||||||
|
|
||||||
mkdir -p $man/share/man/man1
|
# convert the docs/README.md file
|
||||||
|
pandoc --standalone -f markdown -t man docs/README.md -o docs/http.1
|
||||||
docdir=$doc/share/doc/httpie
|
installManPage docs/http.1
|
||||||
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
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# the tests call rst2pseudoxml.py from docutils
|
pytestFlagsArray = [
|
||||||
preCheck = ''
|
"httpie"
|
||||||
export PATH=${docutils}/bin:$PATH
|
"tests"
|
||||||
'';
|
];
|
||||||
|
|
||||||
checkPhase = ''
|
disabledTests = [
|
||||||
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'
|
"test_chunked"
|
||||||
'';
|
"test_verbose_chunked"
|
||||||
|
"test_multipart_chunked"
|
||||||
|
"test_request_body_from_file_by_path_chunked"
|
||||||
|
];
|
||||||
|
|
||||||
|
pythonImportsCheck = [ "httpie" ];
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
description = "A command line HTTP client whose goal is to make CLI human-friendly";
|
description = "A command line HTTP client whose goal is to make CLI human-friendly";
|
||||||
|
Loading…
Reference in New Issue
Block a user