Diff urllib3-1.26.17 with a urllib3-2.0.4

/usr/portage/dev-python/urllib3/urllib3-2.0.4.ebuild 2023-10-09 14:52:30.396368373 +0300
4 4
# please keep this ebuild at EAPI 8 -- sys-apps/portage dep
5 5
EAPI=8
6 6

  
7
DISTUTILS_USE_PEP517=setuptools
7
DISTUTILS_USE_PEP517=hatchling
8 8
PYTHON_TESTED=( python3_{10..12} pypy3 )
9 9
PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" )
10 10
PYTHON_REQ_USE="ssl(+)"
......
19 19

  
20 20
LICENSE="MIT"
21 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"
22
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
23
IUSE="brotli test zstd"
24 24
RESTRICT="!test? ( test )"
25 25

  
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).
26
# [secure] extra is deprecated and slated for removal, we don't need it:
27
# https://github.com/urllib3/urllib3/issues/2680
29 28
RDEPEND="
30 29
	>=dev-python/PySocks-1.5.8[${PYTHON_USEDEP}]
31 30
	<dev-python/PySocks-2.0[${PYTHON_USEDEP}]
32
	dev-python/six[${PYTHON_USEDEP}]
33
	brotli? ( dev-python/brotlicffi[${PYTHON_USEDEP}] )
31
	brotli? ( >=dev-python/brotlicffi-0.8.0[${PYTHON_USEDEP}] )
32
	zstd? ( >=dev-python/zstandard-0.18.0[${PYTHON_USEDEP}] )
34 33
"
35 34
BDEPEND="
36 35
	test? (
37 36
		$(python_gen_cond_dep "
38 37
			${RDEPEND}
39 38
			dev-python/brotlicffi[\${PYTHON_USEDEP}]
40
			dev-python/mock[\${PYTHON_USEDEP}]
39
			dev-python/freezegun[\${PYTHON_USEDEP}]
41 40
			dev-python/pytest[\${PYTHON_USEDEP}]
42
			dev-python/pytest-freezegun[\${PYTHON_USEDEP}]
43 41
			>=dev-python/tornado-4.2.1[\${PYTHON_USEDEP}]
44 42
			>=dev-python/trustme-0.5.3[\${PYTHON_USEDEP}]
43
			>=dev-python/zstandard-0.18.0[\${PYTHON_USEDEP}]
45 44
		" "${PYTHON_TESTED[@]}")
46 45
	)
47 46
"
48 47

  
49 48
src_prepare() {
49
	# upstream considers 0.5 s to be "long" for a timeout
50
	# we get tons of test failures on *fast* systems because of that
51
	sed -i -e '/LONG_TIMEOUT/s:0.5:5:' test/__init__.py || die
50 52
	distutils-r1_src_prepare
51

  
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
58 53
}
59 54

  
60 55
python_test() {
......
65 60
	fi
66 61

  
67 62
	local EPYTEST_DESELECT=(
68
		# unstable (relies on warning count)
69
		test/with_dummyserver/test_proxy_poolmanager.py::TestHTTPProxyManager::test_proxy_verified_warning
70
	)
71
	has "${EPYTHON}" python3.{8..10} && EPYTEST_DESELECT+=(
72
		test/contrib/test_pyopenssl.py::TestPyOpenSSLHelpers::test_get_subj_alt_name
63
		# take forever
64
		test/contrib/test_pyopenssl.py::TestSocketSSL::test_requesting_large_resources_via_ssl
65
		test/with_dummyserver/test_socketlevel.py::TestSSL::test_requesting_large_resources_via_ssl
66
		# stupid test, next bump please verify if they fixed it
67
		test/test_poolmanager.py::TestPoolManager::test_deprecated_no_scheme
68
		# fails with newer secure SSL configuration, which removes TLS 1.1
69
		test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1::test_verify_none_and_good_fingerprint
70
		test/contrib/test_pyopenssl.py::TestHTTPS_TLSv1_1::test_verify_none_and_good_fingerprint
71
		test/with_dummyserver/test_https.py::TestHTTPS_TLSv1::test_verify_none_and_good_fingerprint
72
		test/with_dummyserver/test_https.py::TestHTTPS_TLSv1_1::test_verify_none_and_good_fingerprint
73
		# TODO: timeouts
74
		test/contrib/test_pyopenssl.py::TestSocketClosing::test_timeout_errors_cause_retries
75
		test/with_dummyserver/test_socketlevel.py::TestSocketClosing::test_timeout_errors_cause_retries
76
		# warnings, sigh
77
		test/with_dummyserver/test_connectionpool.py::TestConnectionPool::test_request_chunked_is_deprecated
73 78
	)
74 79

  
80
	# plugins make tests slower, and more fragile
81
	local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
75 82
	epytest
76 83
}
Thank you!