summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-02-01 18:12:38 +0100
committerMichał Górny <mgorny@gentoo.org>2024-02-01 18:12:38 +0100
commitaf4155b1d8634c352841427b3c08700ae3390a38 (patch)
treed20b25d2ce275718ff3dbb6f3a568ff145d286ce /dev-python/urllib3/urllib3-2.2.0.ebuild
parentsys-kernel/gentoo-kernel-bin: Fix genpatches offset in 6.7.3 (diff)
downloadgentoo-af4155b1d8634c352841427b3c08700ae3390a38.tar.gz
gentoo-af4155b1d8634c352841427b3c08700ae3390a38.tar.bz2
gentoo-af4155b1d8634c352841427b3c08700ae3390a38.zip
dev-python/urllib3: Bump to 2.2.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/urllib3/urllib3-2.2.0.ebuild')
-rw-r--r--dev-python/urllib3/urllib3-2.2.0.ebuild92
1 files changed, 92 insertions, 0 deletions
diff --git a/dev-python/urllib3/urllib3-2.2.0.ebuild b/dev-python/urllib3/urllib3-2.2.0.ebuild
new file mode 100644
index 000000000000..7971aac00d0c
--- /dev/null
+++ b/dev-python/urllib3/urllib3-2.2.0.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# please keep this ebuild at EAPI 8 -- sys-apps/portage dep
+EAPI=8
+
+DISTUTILS_USE_PEP517=hatchling
+PYTHON_TESTED=( python3_{10..12} pypy3 )
+PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
+PYTHON_REQ_USE="ssl(+)"
+
+inherit distutils-r1 pypi
+
+# The package has a test dependency on their own hypercorn fork.
+HYPERCORN_COMMIT=d1719f8c1570cbd8e6a3719ffdb14a4d72880abb
+DESCRIPTION="HTTP library with thread-safe connection pooling, file post, and more"
+HOMEPAGE="
+ https://github.com/urllib3/urllib3/
+ https://pypi.org/project/urllib3/
+"
+SRC_URI+="
+ test? (
+ https://github.com/urllib3/hypercorn/archive/${HYPERCORN_COMMIT}.tar.gz
+ -> hypercorn-${HYPERCORN_COMMIT}.gh.tar.gz
+ )
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="brotli http2 test zstd"
+RESTRICT="!test? ( test )"
+
+# [secure] extra is deprecated and slated for removal, we don't need it:
+# https://github.com/urllib3/urllib3/issues/2680
+RDEPEND="
+ >=dev-python/PySocks-1.5.8[${PYTHON_USEDEP}]
+ <dev-python/PySocks-2.0[${PYTHON_USEDEP}]
+ brotli? ( >=dev-python/brotlicffi-0.8.0[${PYTHON_USEDEP}] )
+ http2? (
+ <dev-python/h2-5[${PYTHON_USEDEP}]
+ >=dev-python/h2-4[${PYTHON_USEDEP}]
+ )
+ zstd? ( >=dev-python/zstandard-0.18.0[${PYTHON_USEDEP}] )
+"
+BDEPEND="
+ test? (
+ $(python_gen_cond_dep "
+ ${RDEPEND}
+ dev-python/brotlicffi[\${PYTHON_USEDEP}]
+ dev-python/freezegun[\${PYTHON_USEDEP}]
+ dev-python/h2[\${PYTHON_USEDEP}]
+ dev-python/httpx[\${PYTHON_USEDEP}]
+ dev-python/pytest[\${PYTHON_USEDEP}]
+ dev-python/pytest-rerunfailures[\${PYTHON_USEDEP}]
+ dev-python/pytest-timeout[\${PYTHON_USEDEP}]
+ dev-python/pytest-xdist[\${PYTHON_USEDEP}]
+ dev-python/quart[\${PYTHON_USEDEP}]
+ dev-python/quart-trio[\${PYTHON_USEDEP}]
+ dev-python/trio[\${PYTHON_USEDEP}]
+ >=dev-python/tornado-4.2.1[\${PYTHON_USEDEP}]
+ >=dev-python/trustme-0.5.3[\${PYTHON_USEDEP}]
+ >=dev-python/zstandard-0.18.0[\${PYTHON_USEDEP}]
+ " "${PYTHON_TESTED[@]}")
+ )
+"
+
+src_prepare() {
+ # upstream considers 0.5 s to be "long" for a timeout
+ # we get tons of test failures on *fast* systems because of that
+ sed -i -e '/LONG_TIMEOUT/s:0.5:5:' test/__init__.py || die
+ distutils-r1_src_prepare
+}
+
+python_test() {
+ local -x PYTHONPATH=${WORKDIR}/hypercorn-${HYPERCORN_COMMIT}/src
+ local -x CI=1
+ if ! has "${EPYTHON}" "${PYTHON_TESTED[@]/_/.}"; then
+ einfo "Skipping tests on ${EPYTHON}"
+ return
+ fi
+
+ local EPYTEST_DESELECT=(
+ # TODO: timeouts
+ test/contrib/test_pyopenssl.py::TestSocketClosing::test_timeout_errors_cause_retries
+ test/with_dummyserver/test_socketlevel.py::TestSocketClosing::test_timeout_errors_cause_retries
+ )
+
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+ local EPYTEST_XDIST=1
+ epytest -p timeout -p rerunfailures --reruns=10 --reruns-delay=2
+}