dev-python/backports-csv: Bump to 1.0.7, add tests
[gentoo.git] / dev-python / backports-csv / backports-csv-1.0.7.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
7
8 inherit distutils-r1
9
10 MY_PN=${PN/-/.}
11 MY_P=${MY_PN}-${PV}
12
13 DESCRIPTION="Backport of Python 3's 'csv' module"
14 HOMEPAGE="https://github.com/ryanhiebert/backports.csv https://pypi.org/project/backports.csv/"
15 SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
16
17 LICENSE="PSF-2"
18 SLOT="0"
19 KEYWORDS="~amd64 ~x86"
20 IUSE="test"
21 RESTRICT="!test? ( test )"
22
23 RDEPEND="dev-python/backports[${PYTHON_USEDEP}]"
24 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
25         test? ( ${RDEPEND} )"
26
27 S=${WORKDIR}/${MY_P}
28
29 python_test() {
30         "${EPYTHON}" tests.py -v || die "Tests fail with ${EPYTHON}"
31 }
32
33 python_install_all() {
34         distutils-r1_python_install_all
35         find "${ED}" -name '*.pth' -delete || die
36 }