commit: c4952755d59519af229a8973e08e90291d93ee16 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Tue Mar 2 08:26:48 2021 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Tue Mar 2 08:40:19 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4952755
dev-python/falcon: Python 3.9, tests, modernise Closes: https://bugs.gentoo.org/748279 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-python/falcon/falcon-2.0.0.ebuild | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/dev-python/falcon/falcon-2.0.0.ebuild b/dev-python/falcon/falcon-2.0.0.ebuild index e22b065f73a..ff5be1f6d87 100644 --- a/dev-python/falcon/falcon-2.0.0.ebuild +++ b/dev-python/falcon/falcon-2.0.0.ebuild @@ -1,10 +1,10 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -PYTHON_COMPAT=( python3_{7,8} ) - +PYTHON_COMPAT=( python3_{7,8,9} ) +DISTUTILS_USE_SETUPTOOLS=rdepend inherit distutils-r1 DESCRIPTION="A supersonic micro-framework for building cloud APIs" @@ -15,20 +15,31 @@ LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64 ~x86" IUSE="+cython" -RESTRICT="test" -RDEPEND="dev-python/six[${PYTHON_USEDEP}] +BDEPEND="cython? ( dev-python/cython[${PYTHON_USEDEP}] )" +RDEPEND=" + dev-python/six[${PYTHON_USEDEP}] dev-python/python-mimeparse[${PYTHON_USEDEP}] - cython? ( dev-python/cython[${PYTHON_USEDEP}] )" +" +DEPEND="${RDEPEND}" -DEPEND="${RDEPEND} - dev-python/setuptools[${PYTHON_USEDEP}]" +distutils_enable_tests pytest src_prepare() { if ! use cython; then - sed -i -e 's/if with_cython:/if False:/' setup.py \ - || die 'sed failed.' + sed -i -e 's/if with_cython:/if False:/' setup.py || die fi - eapply_user + default +} + +python_test() { + local deselect=( + # mujson is unpackaged, test-only dep + --ignore tests/test_media_handlers.py + # uses unsafe serialization (unsafe_load) + --deselect tests/test_httperror.py::TestHTTPError::test_custom_error_serializer + ) + + pytest -vv "${deselect[@]}" || die "Tests failed with ${EPYTHON}" }