*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / py / py-1.8.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8} pypy3 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="library with cross-python path, ini-parsing, io, code, log facilities"
11 HOMEPAGE="https://pylib.readthedocs.io/en/latest/ https://pypi.org/project/py/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="MIT"
15 SLOT="0"
16 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="doc"
18
19 BDEPEND="
20         dev-python/setuptools[${PYTHON_USEDEP}]
21         dev-python/setuptools_scm[${PYTHON_USEDEP}]
22         doc? ( dev-python/sphinx )"
23
24 PATCHES=(
25         "${FILESDIR}"/${PN}-1.5.2-skip-apiwarn-pytest31.patch
26         "${FILESDIR}"/${P}-pytest-4.patch
27 )
28
29 distutils_enable_tests pytest
30
31 python_prepare_all() {
32         sed -e 's:intersphinx_mapping:#&:' -i doc/conf.py || die
33
34         distutils-r1_python_prepare_all
35
36         # broken, and relying on exact assertion strings
37         rm testing/code/test_assertion.py || die
38         # broken on py3.8, don't seem important
39         sed -i -e 's:test_syntaxerror_rerepresentation:_&:' \
40                 -e 's:test_comments:_&:' \
41                 testing/code/test_source.py || die
42 }
43
44 python_compile_all() {
45         use doc && emake -C doc html
46 }
47
48 python_install_all() {
49         use doc && local HTML_DOCS=( doc/_build/html/. )
50         distutils-r1_python_install_all
51 }