*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / backports-weakref / backports-weakref-1.0_p1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5 PYTHON_COMPAT=( python2_7 python3_{6,7} )
6
7 inherit distutils-r1
8
9 MY_PN=${PN/-/.}
10 MY_P=${MY_PN}-${PV/_p/.post}
11
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"
15
16 LICENSE="PSF-2.3"
17 SLOT="0"
18 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
19 IUSE=""
20 RDEPEND="dev-python/backports[${PYTHON_USEDEP}]"
21 DEPEND="${RDEPEND}
22         dev-python/setuptools[${PYTHON_USEDEP}]"
23 # Tests require backports.test.support
24 RESTRICT="test"
25 S="${WORKDIR}/${MY_P}"
26
27 python_prepare_all() {
28         sed -e "s|'setuptools_scm'||" \
29                 -i setup.py || die
30         distutils-r1_python_prepare_all
31 }
32
33 python_test() {
34         PYTHONPATH="${BUILD_DIR}/lib" \
35                 "${PYTHON:-python}" tests/test_weakref.py || die "tests failed with ${EPYTHON}"
36 }
37
38 python_install() {
39         # avoid a collision with dev-python/backports
40         rm "${BUILD_DIR}"/lib/backports/__init__.py || die
41         distutils-r1_python_install --skip-build
42 }