version bumps and a few new packages
[dbus-free.git] / dev-python / urllib3 / urllib3-1.26.18.ebuild
blob151ef0e7ae0c595af60360d046dfe0a1baf306fb
1 # Copyright 1999-2023 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # please keep this ebuild at EAPI 8 -- sys-apps/portage dep
5 EAPI=8
7 DISTUTILS_USE_PEP517=setuptools
8 PYTHON_TESTED=( python3_{10..12} pypy3 )
9 PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
10 PYTHON_REQ_USE="ssl(+)"
12 inherit distutils-r1 pypi
14 DESCRIPTION="HTTP library with thread-safe connection pooling, file post, and more"
15 HOMEPAGE="
16         https://github.com/urllib3/urllib3/
17         https://pypi.org/project/urllib3/
20 LICENSE="MIT"
21 SLOT="0"
22 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~ppc-macos ~x64-macos ~x64-solaris"
23 IUSE="brotli test"
24 RESTRICT="!test? ( test )"
26 # dev-python/{pyopenssl,cryptography,idna,certifi} are optional runtime
27 # dependencies. Do not add them to RDEPEND. They should be unnecessary with
28 # modern versions of python (>= 3.2).
29 RDEPEND="
30         >=dev-python/PySocks-1.5.8[${PYTHON_USEDEP}]
31         <dev-python/PySocks-2.0[${PYTHON_USEDEP}]
32         dev-python/six[${PYTHON_USEDEP}]
33         brotli? ( dev-python/brotlicffi[${PYTHON_USEDEP}] )
35 BDEPEND="
36         test? (
37                 $(python_gen_cond_dep "
38                         ${RDEPEND}
39                         dev-python/brotlicffi[\${PYTHON_USEDEP}]
40                         dev-python/mock[\${PYTHON_USEDEP}]
41                         dev-python/pytest[\${PYTHON_USEDEP}]
42                         dev-python/pytest-freezegun[\${PYTHON_USEDEP}]
43                         >=dev-python/tornado-4.2.1[\${PYTHON_USEDEP}]
44                         >=dev-python/trustme-0.5.3[\${PYTHON_USEDEP}]
45                 " "${PYTHON_TESTED[@]}")
46         )
49 src_prepare() {
50         distutils-r1_src_prepare
52         # unbundle urllib3
53         rm src/urllib3/packages/six.py || die
54         find -name '*.py' -exec sed -i \
55                 -e 's:\([.]*\|urllib3\.\)\?packages\.six:six:g' \
56                 -e 's:from \([.]*\|urllib3\.\)\?packages import six:import six:g' \
57                 {} + || die
60 python_test() {
61         local -x CI=1
62         if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then
63                 einfo "Skipping tests on ${EPYTHON}"
64                 return
65         fi
67         local EPYTEST_DESELECT=(
68                 # unstable (relies on warning count)
69                 test/with_dummyserver/test_proxy_poolmanager.py::TestHTTPProxyManager::test_proxy_verified_warning
70                 # some random overflow
71                 test/with_dummyserver/test_socketlevel.py::TestSSL::test_requesting_large_resources_via_ssl
72         )
73         has "${EPYTHON}" python3.{8..10} && EPYTEST_DESELECT+=(
74                 test/contrib/test_pyopenssl.py::TestPyOpenSSLHelpers::test_get_subj_alt_name
75         )
77         epytest