Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/requests/
Date: Fri, 13 May 2022 11:21:33
Message-Id: 1652440885.a9fd3a81756b70760b6fa1d4905e93c767a3ee5a.mgorny@gentoo
1 commit: a9fd3a81756b70760b6fa1d4905e93c767a3ee5a
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 13 11:03:50 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri May 13 11:21:25 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9fd3a81
7
8 dev-python/requests: Use PEP517 build
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/requests/requests-2.27.1-r1.ebuild | 68 +++++++++++++++++++++++++++
13 1 file changed, 68 insertions(+)
14
15 diff --git a/dev-python/requests/requests-2.27.1-r1.ebuild b/dev-python/requests/requests-2.27.1-r1.ebuild
16 new file mode 100644
17 index 000000000000..a33a1d8c1478
18 --- /dev/null
19 +++ b/dev-python/requests/requests-2.27.1-r1.ebuild
20 @@ -0,0 +1,68 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +# please keep this ebuild at EAPI 7 -- sys-apps/portage dep
25 +EAPI=7
26 +
27 +DISTUTILS_USE_PEP517=setuptools
28 +PYTHON_COMPAT=( python3_{8..10} pypy3 )
29 +PYTHON_REQ_USE="threads(+)"
30 +
31 +inherit distutils-r1
32 +
33 +DESCRIPTION="HTTP library for human beings"
34 +HOMEPAGE="
35 + https://requests.readthedocs.io/
36 + https://github.com/psf/requests/
37 + https://pypi.org/project/requests/
38 +"
39 +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
40 +
41 +LICENSE="Apache-2.0"
42 +SLOT="0"
43 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
44 +IUSE="socks5"
45 +
46 +RDEPEND="
47 + >=dev-python/certifi-2017.4.17[${PYTHON_USEDEP}]
48 + dev-python/charset_normalizer[${PYTHON_USEDEP}]
49 + <dev-python/idna-4[${PYTHON_USEDEP}]
50 + <dev-python/urllib3-1.27[${PYTHON_USEDEP}]
51 + socks5? ( >=dev-python/PySocks-1.5.6[${PYTHON_USEDEP}] )
52 +"
53 +
54 +BDEPEND="
55 + test? (
56 + dev-python/pytest-httpbin[${PYTHON_USEDEP}]
57 + dev-python/pytest-mock[${PYTHON_USEDEP}]
58 + >=dev-python/PySocks-1.5.6[${PYTHON_USEDEP}]
59 + !alpha? ( !hppa? ( !ia64? (
60 + dev-python/trustme[${PYTHON_USEDEP}]
61 + ) ) )
62 + )
63 +"
64 +
65 +distutils_enable_tests pytest
66 +
67 +python_test() {
68 + local EPYTEST_DESELECT=(
69 + # Internet (doctests)
70 + requests/__init__.py::requests
71 + requests/api.py::requests.api.request
72 + requests/models.py::requests.models.PreparedRequest
73 + requests/sessions.py::requests.sessions.Session
74 + # require IPv4 interface in 10.* range
75 + tests/test_requests.py::TestTimeout::test_connect_timeout
76 + tests/test_requests.py::TestTimeout::test_total_timeout_connect
77 + # TODO: openssl?
78 + tests/test_requests.py::TestRequests::test_pyopenssl_redirect
79 + )
80 +
81 + if ! has_version "dev-python/trustme[${PYTHON_USEDEP}]"; then
82 + EPYTEST_DESELECT+=(
83 + tests/test_requests.py::TestRequests::test_https_warnings
84 + )
85 + fi
86 +
87 + epytest
88 +}