1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} pypy3 )
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"
16 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
20 dev-python/setuptools[${PYTHON_USEDEP}]
21 dev-python/setuptools_scm[${PYTHON_USEDEP}]
22 doc? ( dev-python/sphinx )"
25 "${FILESDIR}"/${PN}-1.5.2-skip-apiwarn-pytest31.patch
26 "${FILESDIR}"/${P}-pytest-4.patch
29 distutils_enable_tests pytest
31 python_prepare_all() {
32 sed -e 's:intersphinx_mapping:#&:' -i doc/conf.py || die
34 distutils-r1_python_prepare_all
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 # broken on py3.9, this package is just dead
43 sed -i -e 's:test_excinfo_\(repr\|set\):_&:' \
44 -e 's:test_format_excinfo:_&:' \
45 -e 's:test_excinfo_str:_&:' \
46 testing/code/test_excinfo.py || die
47 sed -i -e 's:test_getfslineno:_&:' \
48 testing/code/test_source.py || die
51 python_compile_all() {
52 use doc && emake -C doc html
55 python_install_all() {
56 use doc && local HTML_DOCS=( doc/_build/html/. )
57 distutils-r1_python_install_all