dev-python/atomicwrites: stable 1.1.5-r3 for sparc, bug #676592
[gentoo.git] / dev-python / python-sqlparse / python-sqlparse-0.2.4.ebuild
1 # Copyright 1999-2018 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy )
7
8 inherit distutils-r1
9
10 MY_PN="${PN##python-}"
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="A non-validating SQL parser module for Python"
14 HOMEPAGE="https://github.com/andialbrecht/sqlparse"
15 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
16
17 SLOT="0"
18 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux"
19 LICENSE="BSD-2"
20 IUSE="doc test"
21
22 REQUIRED_USE="doc? ( || ( $(python_gen_useflags 'python2*') ) )"
23
24 DEPEND="
25         dev-python/setuptools[${PYTHON_USEDEP}]
26         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
27         test? (
28                 dev-python/pytest[${PYTHON_USEDEP}]
29                 dev-python/pytest-cov[${PYTHON_USEDEP}]
30                 )"
31 # Required for running tests
32 DISTUTILS_IN_SOURCE_BUILD=1
33
34 S="${WORKDIR}"/${P#python-}
35
36 pkg_setup() {
37         use doc && DISTUTILS_ALL_SUBPHASE_IMPLS=( 'python2*' )
38 }
39
40 python_compile_all() {
41         use doc && emake -C docs html
42 }
43
44 python_test() {
45         if python_is_python3; then
46                 2to3 -w --no-diffs -n tests/ sqlparse/
47                 py.test ./tests || die "testsuite failed ${EPYTHON}"
48         else
49                 py.test tests || die "testsuite failed under ${EPYTHON}"
50         fi
51 }
52
53 python_install_all() {
54         use doc && local HTML_DOCS=( docs/build/html/. )
55         distutils-r1_python_install_all
56 }