590b45ff9686c915354288b2e9039527455c69da
[gentoo.git] / dev-python / pyrqlite / pyrqlite-2.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 PYTHON_COMPAT=( python{2_7,3_6} )
6
7 inherit distutils-r1
8
9 if [[ ${PV} == *9999* ]]; then
10         inherit git-r3
11 fi
12
13 DESCRIPTION="Python client for rqlite"
14 EGIT_REPO_URI="https://github.com/rqlite/pyrqlite.git"
15 HOMEPAGE="https://github.com/rqlite/pyrqlite"
16 SRC_URI="${EGIT_REPO_URI%.git}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
17
18 LICENSE="MIT"
19 SLOT="0"
20 KEYWORDS="~amd64 ~x86"
21 IUSE="test"
22 RESTRICT="!test? ( test )"
23
24 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
25         test? (
26                 dev-python/pytest[${PYTHON_USEDEP}]
27                 dev-python/pytest-cov[${PYTHON_USEDEP}]
28                 dev-python/pylint[${PYTHON_USEDEP}]
29         )"
30
31 src_prepare() {
32         sed -e "s:^__version__ = .*:__version__ = '${PV}':" -i src/${PN}/constants.py || die
33         distutils-r1_src_prepare
34 }
35
36 python_test() {
37         esetup.py test || die "tests failed"
38         esetup.py lint -f text -E || die "pylint failed"
39 }