commit:     c9ef6b5d055e9451dc20ea4094d7ba9dc6551b4f
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sat Jun  6 17:40:03 2020 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Sat Jun  6 17:40:28 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c9ef6b5d

dev-python/cairocffi: Support newer python

This allows consumers needing python2 support to coexist with packages
needed newer python. By the way, also apply the patch that is used in 0.8
and 1.1 versions to workaround broken tests.

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 dev-python/cairocffi/cairocffi-0.9.0-r1.ebuild | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/dev-python/cairocffi/cairocffi-0.9.0-r1.ebuild 
b/dev-python/cairocffi/cairocffi-0.9.0-r1.ebuild
index 45e349b5808..6793e7f9b0e 100644
--- a/dev-python/cairocffi/cairocffi-0.9.0-r1.ebuild
+++ b/dev-python/cairocffi/cairocffi-0.9.0-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI="7"
 
-PYTHON_COMPAT=( python2_7 python3_{6,7} )
+PYTHON_COMPAT=( python2_7 python3_{6..9} )
 
 inherit distutils-r1 virtualx
 
@@ -17,9 +17,11 @@ SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~x86"
-IUSE="doc test"
+IUSE="test"
 RESTRICT="!test? ( test )"
 
+distutils_enable_sphinx docs
+
 RDEPEND="
        $(python_gen_cond_dep '>=dev-python/cffi-1.1.0:=[${PYTHON_USEDEP}]' 
'python*')
        >=dev-python/xcffib-0.3.2[${PYTHON_USEDEP}]
@@ -28,7 +30,6 @@ RDEPEND="
 
 DEPEND="
        dev-python/setuptools[${PYTHON_USEDEP}]
-       doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
        test? (
                ${RDEPEND}
                dev-python/pytest[${PYTHON_USEDEP}]
@@ -36,15 +37,15 @@ DEPEND="
 
 S="${WORKDIR}/${MY_P}"
 
-python_compile_all() {
-       use doc && esetup.py build_sphinx
+PATCHES=( "${FILESDIR}"/${PN}-0.8.0-tests.patch )
+
+python_prepare() {
+       if python_is_python3; then
+               # Remove deprecated statements for python3
+               sed -i -e 's/tostring/tobytes/g' cairocffi/test_cairo.py || die
+       fi
 }
 
 python_test() {
        virtx py.test -v --pyargs cairocffi -o addopts=
 }
-
-python_install_all() {
-       use doc && HTML_DOCS=( docs/_build/html/. )
-       distutils-r1_python_install_all
-}

Reply via email to