Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/httpie/files/, net-misc/httpie/
Date: Sat, 29 Jun 2019 14:55:52
Message-Id: 1561820102.3c24ce845a8c9999079c422f6b0512f74f901ec3.whissi@gentoo
1 commit: 3c24ce845a8c9999079c422f6b0512f74f901ec3
2 Author: Ralph Seichter <github <AT> seichter <DOT> de>
3 AuthorDate: Sat Jun 29 14:45:06 2019 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sat Jun 29 14:55:02 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c24ce84
7
8 net-misc/httpie: fix test failures
9
10 * test_ssl.py states that "pytest-httpbin doesn't support ssl3" and
11 asserts that a caught exception contains a certain string. A patch in
12 this ebuild extends the list of expected strings.
13
14 * Added dependency to dev-python/mock.
15
16 Closes: https://bugs.gentoo.org/686306
17 Signed-off-by: Ralph Seichter <gentoo <AT> seichter.de>
18 Package-Manager: Portage-2.3.66, Repoman-2.3.11
19 Closes: https://github.com/gentoo/gentoo/pull/12352
20 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
21
22 .../httpie/files/httpie-1.0.2-fix-test_ssl.patch | 11 ++++++
23 net-misc/httpie/httpie-1.0.2-r1.ebuild | 43 ++++++++++++++++++++++
24 2 files changed, 54 insertions(+)
25
26 diff --git a/net-misc/httpie/files/httpie-1.0.2-fix-test_ssl.patch b/net-misc/httpie/files/httpie-1.0.2-fix-test_ssl.patch
27 new file mode 100644
28 index 00000000000..212f91f41e8
29 --- /dev/null
30 +++ b/net-misc/httpie/files/httpie-1.0.2-fix-test_ssl.patch
31 @@ -0,0 +1,11 @@
32 +--- a/tests/test_ssl.py 2018-11-14 16:36:19.000000000 +0100
33 ++++ b/tests/test_ssl.py 2019-06-29 16:28:09.466528486 +0200
34 +@@ -45,7 +45,7 @@
35 + except ssl_errors as e:
36 + if ssl_version == 'ssl3':
37 + # pytest-httpbin doesn't support ssl3
38 +- assert 'SSLV3_ALERT_HANDSHAKE_FAILURE' in str(e)
39 ++ assert 'SSLV3_ALERT_HANDSHAKE_FAILURE' in str(e) or 'handshake failure' in str(e)
40 + else:
41 + raise
42 +
43
44 diff --git a/net-misc/httpie/httpie-1.0.2-r1.ebuild b/net-misc/httpie/httpie-1.0.2-r1.ebuild
45 new file mode 100644
46 index 00000000000..e7057e9fb65
47 --- /dev/null
48 +++ b/net-misc/httpie/httpie-1.0.2-r1.ebuild
49 @@ -0,0 +1,43 @@
50 +# Copyright 1999-2019 Gentoo Authors
51 +# Distributed under the terms of the GNU General Public License v2
52 +
53 +EAPI=7
54 +
55 +PYTHON_COMPAT=( python2_7 python3_{5,6} )
56 +PYTHON_REQ_USE="ssl(+)"
57 +
58 +inherit bash-completion-r1 distutils-r1
59 +
60 +DESCRIPTION="Modern command line HTTP client"
61 +HOMEPAGE="https://httpie.org/ https://pypi.org/project/httpie/"
62 +SRC_URI="https://github.com/jakubroztocil/httpie/archive/${PV}.tar.gz -> ${P}.tar.gz"
63 +
64 +LICENSE="BSD"
65 +SLOT="0"
66 +KEYWORDS="~amd64 ~x86"
67 +IUSE="test"
68 +
69 +RDEPEND="dev-python/pygments[${PYTHON_USEDEP}]
70 + >=dev-python/requests-2.19.1[${PYTHON_USEDEP}]"
71 +DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
72 + test? (
73 + ${RDEPEND}
74 + dev-python/mock[${PYTHON_USEDEP}]
75 + dev-python/pyopenssl[${PYTHON_USEDEP}]
76 + dev-python/pytest-httpbin[${PYTHON_USEDEP}]
77 + dev-python/pytest[${PYTHON_USEDEP}]
78 + )"
79 +
80 +# Extend list of expected strings in test
81 +PATCHES=( "${FILESDIR}/${PN}-1.0.2-fix-test_ssl.patch" )
82 +
83 +python_test() {
84 + pytest -vv || die "Tests failed with ${EPYTHON}"
85 +}
86 +
87 +python_install_all() {
88 + newbashcomp extras/httpie-completion.bash http
89 + insinto /usr/share/fish/vendor_completions.d
90 + newins extras/httpie-completion.fish http.fish
91 + distutils-r1_python_install_all
92 +}