Skip to content

Commit cd37f8e

Browse files
committed
dev-python/uvloop: fix cython-3 compat
Bug: MagicStack/uvloop#586 Bug: MagicStack/uvloop#587 Signed-off-by: Sam James <sam@gentoo.org>
1 parent b4530f0 commit cd37f8e

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

dev-python/uvloop/Manifest

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
DIST uvloop-0.19.0-cython3.patch.xz 6352 BLAKE2B 4a7056299d3d430ce5b6986d43ba4f20726ae4f9635042a43e2995ea373ed53ddce6af2eaa32202f81f80a27bd1d814e635a6be091b5f751bcf6825fd2c8e88a SHA512 aeda541f1327860d23b31ffda9923270a56a8311ec86b06f3bd653478bff591372106e8848af5229e3ad298e950b4c3a728ab4dd9056219b8afe55f5dd58ee3d
12
DIST uvloop-0.19.0.tar.gz 2318492 BLAKE2B 1c46a8bf3e204c261e3a5e60c3583b75b8b9b20086443725c42842f96ea3f6804242470aa9569f8cc74a6e3bd38b5aaa70f9a9d92b5df3e73911acc169185570 SHA512 b6ca7ba7baf61dc930bb92e35013e5abaf7a227a5e99c88ec4b58fa87a40692151d9891b81d9e514a8481df62bb9721baa789ec234dcbbb34f69e0bee489c57c
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Copyright 1999-2024 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
EAPI=8
5+
6+
DISTUTILS_EXT=1
7+
DISTUTILS_USE_PEP517=setuptools
8+
PYTHON_COMPAT=( python3_{10..12} )
9+
10+
inherit distutils-r1 pypi
11+
12+
DESCRIPTION="Ultra-fast implementation of asyncio event loop on top of libuv"
13+
HOMEPAGE="
14+
https://github.com/magicstack/uvloop/
15+
https://pypi.org/project/uvloop/
16+
"
17+
SRC_URI+=" https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${PN}-0.19.0-cython3.patch.xz"
18+
19+
KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 -riscv ~sparc ~x86"
20+
LICENSE="MIT"
21+
SLOT="0"
22+
IUSE="examples"
23+
24+
DEPEND="
25+
>=dev-libs/libuv-1.11.0:=
26+
"
27+
RDEPEND="
28+
${DEPEND}
29+
"
30+
BDEPEND="
31+
>=dev-python/cython-0.29.36[${PYTHON_USEDEP}]
32+
test? (
33+
dev-python/aiohttp[${PYTHON_USEDEP}]
34+
>=dev-python/pyopenssl-22.0.0[${PYTHON_USEDEP}]
35+
dev-python/psutil[${PYTHON_USEDEP}]
36+
)
37+
"
38+
39+
PATCHES=(
40+
"${WORKDIR}"/${PN}-0.19.0-cython3.patch
41+
)
42+
43+
distutils_enable_tests pytest
44+
45+
python_prepare_all() {
46+
rm -r vendor || die
47+
cat <<-EOF >> setup.cfg || die
48+
[build_ext]
49+
use_system_libuv=True
50+
cython_always=True
51+
EOF
52+
53+
# force cythonization
54+
rm uvloop/loop.c || die
55+
56+
distutils-r1_python_prepare_all
57+
}
58+
59+
python_test() {
60+
local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
61+
local EPYTEST_IGNORE=(
62+
# linting
63+
tests/test_sourcecode.py
64+
)
65+
local EPYTEST_DESELECT=(
66+
# TODO: expects some... cython_helper?
67+
tests/test_libuv_api.py::Test_UV_libuv::test_libuv_get_loop_t_ptr
68+
# unhappy about sandbox injecting its envvars
69+
tests/test_process.py::Test_UV_Process::test_process_env_2
70+
tests/test_process.py::Test_AIO_Process::test_process_env_2
71+
# hangs
72+
tests/test_tcp.py::Test_AIO_TCPSSL::test_remote_shutdown_receives_trailing_data
73+
# crashes on assertion
74+
# https://github.com/MagicStack/uvloop/issues/574
75+
tests/test_cython.py::TestCythonIntegration::test_cython_coro_is_coroutine
76+
)
77+
78+
rm -rf uvloop || die
79+
epytest -s
80+
}
81+
82+
python_install_all() {
83+
use examples && dodoc -r examples
84+
distutils-r1_python_install_all
85+
}

0 commit comments

Comments
 (0)