aboutsummaryrefslogtreecommitdiff
blob: 891e7b58fb4fb6ac37c609117a7fcdbb022b273b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="7"

PYTHON_COMPAT=( python3_7 )

DOCS_BUILDER="sphinx"
DOCS_DIR="${S}/docs"
DOCS_DEPEND="
	dev-python/anyio
	>=dev-python/sphinx-autodoc-typehints-1.2.0
	dev-python/sphinx_rtd_theme
"
DOCS_AUTODOC=1

inherit distutils-r1 docs

DESCRIPTION="Compatibility layer for multiple asynchronous event loop implementations"
HOMEPAGE="
	https://github.com/agronholm/anyio
	https://pypi.org/project/anyio
"
SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"

LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"

RDEPEND="
	>=dev-python/curio-1.4[${PYTHON_USEDEP}]
	>=dev-python/idna-2.8[${PYTHON_USEDEP}]
	>=dev-python/sniffio-1.1[${PYTHON_USEDEP}]
	>=dev-python/trio-0.16[${PYTHON_USEDEP}]
"
#remember to add 
#	$(python_gen_cond_dep 'dev-python/typing_extensions[${PYTHON_USEDEP}]' python3_7)
DEPEND="
	${RDEPEND}
	test? (
		>=dev-python/hypothesis-4.0[${PYTHON_USEDEP}]
		>=dev-python/pytest-6.0[${PYTHON_USEDEP}]
		dev-python/trustme[${PYTHON_USEDEP}]
		dev-python/uvloop[${PYTHON_USEDEP}]
	)
"

distutils_enable_tests pytest

python_test() {
	distutils_install_for_testing
	pytest -vv \
			--deselect tests/test_sockets.py::test_getaddrinfo[asyncio] \
			--deselect tests/test_sockets.py::test_getaddrinfo[asyncio+uvloop] \
			--deselect tests/test_sockets.py::test_getaddrinfo[curio] \
			--deselect tests/test_sockets.py::test_getaddrinfo[trio] \
	|| die
}