dev-python/uvicorn: use optfeature instead of flags

these are mere runtime dependencies, see the 'when not to use USE flags'
https://devmanual.gentoo.org/general-concepts/use-flags/index.html

Package-Manager: Portage-2.3.93, Repoman-2.3.20
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
This commit is contained in:
Andrew Ammerlaan
2020-03-13 16:00:32 +01:00
parent 75b8db2bec
commit 5a3bd7dfdf
2 changed files with 22 additions and 14 deletions

View File

@@ -6,9 +6,4 @@
<email>andrewammerlaan@riseup.net</email>
<name>Andrew Ammerlaan</name>
</maintainer>
<use>
<flag name="wsproto">add websockets support using wsproto package</flag>
<flag name="websockets">add websockets support using websockets package</flag>
<flag name="httptools">use httpstools package for http protocol</flag>
</use>
</pkgmetadata>

View File

@@ -7,7 +7,7 @@ PYTHON_COMPAT=( python3_{6,7} )
DISTUTILS_USE_SETUPTOOLS=rdepend
inherit distutils-r1
inherit distutils-r1 eutils
DESCRIPTION="The lightning-fast ASGI server"
HOMEPAGE="https://www.uvicorn.org/
@@ -18,32 +18,38 @@ LICENSE="BSD"
KEYWORDS="~amd64 ~x86"
SLOT="0"
IUSE="wsproto websockets httptools doc"
IUSE="doc"
REQUIRED_USE="x86? ( !doc )"
RDEPEND="
dev-python/click[${PYTHON_USEDEP}]
dev-python/h11[${PYTHON_USEDEP}]
>=dev-python/uvloop-0.14.0[${PYTHON_USEDEP}]
wsproto? ( dev-python/wsproto[${PYTHON_USEDEP}] )
websockets? ( >=dev-python/websockets-6.0[${PYTHON_USEDEP}] )
httptools? ( >=dev-python/httptools-0.1.1[${PYTHON_USEDEP}] )"
dev-python/h11[${PYTHON_USEDEP}]"
BDEPEND="doc? ( !x86? (
dev-python/mkdocs
dev-python/mkdocs-material ) )"
DEPEND="test? (
dev-python/black[${PYTHON_USEDEP}]
dev-python/isort[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}] )"
dev-python/requests[${PYTHON_USEDEP}]
>=dev-python/uvloop-0.14.0[${PYTHON_USEDEP}]
dev-python/wsproto[${PYTHON_USEDEP}]
>=dev-python/websockets-6.0[${PYTHON_USEDEP}]
>=dev-python/httptools-0.1.1[${PYTHON_USEDEP}] )"
distutils_enable_tests pytest
python_prepare_all() {
# these tests fail, likely because wsproto is out of date
# these tests fail to collect, likely because wsproto is out of date
# ImportError: cannot import name 'ConnectionType'
rm tests/protocols/test_websocket.py || die
rm tests/protocols/test_http.py || die
# AttributeError: module 'uvicorn.protocols.http' has no attribute 'h11_impl'
sed -i -e 's:test_concrete_http_class:_&:' \
tests/test_config.py || die
# do not install LICENSE to /usr/
sed -i -e '/data_files/d' setup.py || die
@@ -57,3 +63,10 @@ python_compile_all() {
HTML_DOCS="site"
fi
}
pkg_postinst() {
optfeature "asyncio event loop on top of libuv" dev-python/uvloop
optfeature "websockets support using wsproto" dev-python/wsproto
optfeature "websockets support using websockets" dev-python/websockets
optfeature "httpstools package for http protocol" dev-python/httptools
}