1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 PYTHON_COMPAT=( python2_7 python3_{6,7} )
10 MY_P=${MY_PN}-${PV/_p/.post}
12 DESCRIPTION="Backport of new features in Python's weakref module"
13 HOMEPAGE="https://github.com/PiDelport/backports.weakref https://pypi.org/project/backports.weakref/"
14 SRC_URI="mirror://pypi/${P:0:1}/${MY_PN}/${MY_P}.tar.gz"
18 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
20 RDEPEND="dev-python/backports[${PYTHON_USEDEP}]"
22 dev-python/setuptools[${PYTHON_USEDEP}]"
23 # Tests require backports.test.support
25 S="${WORKDIR}/${MY_P}"
27 python_prepare_all() {
28 sed -e "s|'setuptools_scm'||" \
30 distutils-r1_python_prepare_all
34 PYTHONPATH="${BUILD_DIR}/lib" \
35 "${PYTHON:-python}" tests/test_weakref.py || die "tests failed with ${EPYTHON}"
39 # avoid a collision with dev-python/backports
40 rm "${BUILD_DIR}"/lib/backports/__init__.py || die
41 distutils-r1_python_install --skip-build