tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
httpie: 2.2.0 -> 2.4.0
Sandro Jäckel
5 years ago
a56bc4a9
cb52887c
+23
-32
2 changed files
expand all
collapse all
unified
split
pkgs
tools
networking
httpie
default.nix
strip-venv.patch
+15
-27
pkgs/tools/networking/httpie/default.nix
···
1
-
{ lib, fetchFromGitHub, python3Packages, docutils, fetchpatch }:
2
3
python3Packages.buildPythonApplication rec {
4
pname = "httpie";
5
-
version = "2.2.0";
6
7
src = fetchFromGitHub {
8
-
owner = "jakubroztocil";
9
repo = "httpie";
10
rev = version;
11
-
sha256 = "0caazv24jr0844c4mdx77vzwwi5m869n10wa42cydb08ppx1xxj6";
12
};
13
14
-
outputs = [ "out" "doc" "man" ];
15
-
16
-
propagatedBuildInputs = with python3Packages; [ pygments requests setuptools ];
17
-
dontUseSetuptoolsCheck = true;
18
patches = [
19
./strip-venv.patch
20
-
21
-
# Fix `test_ciphers_none_can_be_selected`
22
-
# TODO: remove on next release
23
-
(fetchpatch {
24
-
url = "https://github.com/jakubroztocil/httpie/commit/49e71d252f54871a6bc49cb1cba103d385a543b8.patch";
25
-
sha256 = "13b2faf50gimj7f17dlx4gmd8ph8ipgihpzfqbvmfjlbf1v95fsj";
26
-
})
27
];
28
0
0
0
0
29
checkInputs = with python3Packages; [
30
mock
31
pytest
···
70
toHtml CHANGELOG.rst $docdir/html/CHANGELOG.html
71
toHtml CONTRIBUTING.rst $docdir/html/CONTRIBUTING.html
72
73
-
# change a few links to the local files
74
-
substituteInPlace $docdir/html/index.html \
75
-
--replace \
76
-
'https://github.com/jakubroztocil/httpie/blob/master/CHANGELOG.rst' \
77
-
"CHANGELOG.html" \
78
-
--replace \
79
-
'https://github.com/jakubroztocil/httpie/blob/master/CONTRIBUTING.rst' \
80
-
"CONTRIBUTING.html"
81
-
82
${docutils}/bin/rst2man \
83
--strip-elements-with-class=no-web \
84
--title=http \
···
94
export PATH=${docutils}/bin:$PATH
95
'';
96
97
-
meta = {
0
0
0
0
98
description = "A command line HTTP client whose goal is to make CLI human-friendly";
99
homepage = "https://httpie.org/";
100
-
license = lib.licenses.bsd3;
101
-
maintainers = with lib.maintainers; [ antono relrod schneefux ];
102
};
103
}
···
1
+
{ lib, fetchFromGitHub, python3Packages, docutils }:
2
3
python3Packages.buildPythonApplication rec {
4
pname = "httpie";
5
+
version = "2.4.0";
6
7
src = fetchFromGitHub {
8
+
owner = "httpie";
9
repo = "httpie";
10
rev = version;
11
+
sha256 = "00lafjqg9nfnak0nhcr2l2hzzkwn2y6qv0wdkm6r6f69snizy3hf";
12
};
13
0
0
0
0
14
patches = [
15
./strip-venv.patch
0
0
0
0
0
0
0
16
];
17
18
+
outputs = [ "out" "doc" "man" ];
19
+
20
+
propagatedBuildInputs = with python3Packages; [ pygments requests requests-toolbelt setuptools ];
21
+
22
checkInputs = with python3Packages; [
23
mock
24
pytest
···
63
toHtml CHANGELOG.rst $docdir/html/CHANGELOG.html
64
toHtml CONTRIBUTING.rst $docdir/html/CONTRIBUTING.html
65
0
0
0
0
0
0
0
0
0
66
${docutils}/bin/rst2man \
67
--strip-elements-with-class=no-web \
68
--title=http \
···
78
export PATH=${docutils}/bin:$PATH
79
'';
80
81
+
checkPhase = ''
82
+
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'
83
+
'';
84
+
85
+
meta = with lib; {
86
description = "A command line HTTP client whose goal is to make CLI human-friendly";
87
homepage = "https://httpie.org/";
88
+
license = licenses.bsd3;
89
+
maintainers = with maintainers; [ antono relrod schneefux SuperSandro2000 ];
90
};
91
}
+8
-5
pkgs/tools/networking/httpie/strip-venv.patch
···
1
diff --git a/tests/test_docs.py b/tests/test_docs.py
2
-
index 7a41822..720ecf6 100644
3
--- a/tests/test_docs.py
4
+++ b/tests/test_docs.py
5
-
@@ -41,12 +41,10 @@ assert filenames
6
-
7
# HACK: hardcoded paths, venv should be irrelevant, etc.
8
-
# TODO: replaces the process with Python code
0
9
-VENV_BIN = Path(__file__).parent.parent / 'venv/bin'
10
-VENV_PYTHON = VENV_BIN / 'python'
11
-VENV_RST2PSEUDOXML = VENV_BIN / 'rst2pseudoxml.py'
···
13
+VENV_RST2PSEUDOXML = 'rst2pseudoxml.py'
14
15
16
-
-@pytest.mark.skipif(not os.path.exists(VENV_RST2PSEUDOXML), reason='docutils not installed')
0
0
0
17
@pytest.mark.parametrize('filename', filenames)
18
def test_rst_file_syntax(filename):
19
p = subprocess.Popen(
···
1
diff --git a/tests/test_docs.py b/tests/test_docs.py
2
+
index 340e64d..a6b4dc9 100644
3
--- a/tests/test_docs.py
4
+++ b/tests/test_docs.py
5
+
@@ -42,15 +42,10 @@ assert filenames
0
6
# HACK: hardcoded paths, venv should be irrelevant, etc.
7
+
# TODO: simplify by using the Python API instead of a subprocess
8
+
# then we wont’t need the paths.
9
-VENV_BIN = Path(__file__).parent.parent / 'venv/bin'
10
-VENV_PYTHON = VENV_BIN / 'python'
11
-VENV_RST2PSEUDOXML = VENV_BIN / 'rst2pseudoxml.py'
···
13
+VENV_RST2PSEUDOXML = 'rst2pseudoxml.py'
14
15
16
+
-@pytest.mark.skipif(
17
+
- not VENV_RST2PSEUDOXML.exists(),
18
+
- reason='docutils not installed',
19
+
-)
20
@pytest.mark.parametrize('filename', filenames)
21
def test_rst_file_syntax(filename):
22
p = subprocess.Popen(