1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python{2_7,3_3,3_4} pypy pypy3 )
9 DESCRIPTION="py.test: simple powerful testing with Python"
10 HOMEPAGE="http://pytest.org/ https://pypi.python.org/pypi/pytest"
11 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
15 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
18 # When bumping, please check setup.py for the proper py version
20 RDEPEND=">=dev-python/py-${PY_VER}[${PYTHON_USEDEP}]"
22 #pexpect dep based on https://bitbucket.org/hpk42/pytest/issue/386/tests-fail-with-pexpect-30
24 dev-python/setuptools[${PYTHON_USEDEP}]
25 test? ( dev-python/pexpect[${PYTHON_USEDEP}] )
26 doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
28 python_prepare_all() {
29 # Disable versioning of py.test script to avoid collision with
30 # versioning performed by the eclass.
31 sed -e "s/return points/return {'py.test': target}/" -i setup.py || die "sed failed"
32 grep -qF "py>=${PY_VER}" setup.py || die "Incorrect dev-python/py dependency"
34 # Prevent un-needed d'loading
35 sed -e "s/'sphinx.ext.intersphinx', //" -i doc/en/conf.py || die
36 distutils-r1_python_prepare_all
39 python_compile_all() {
41 mkdir doc/en/.build || die
47 # test_nose.py not written to suit py3.2 in pypy3
48 if [[ "${EPYTHON}" == pypy3 ]]; then
49 "${PYTHON}" "${BUILD_DIR}"/lib/pytest.py \
50 --ignore=testing/test_nose.py \
51 || die "tests failed with ${EPYTHON}"
53 "${PYTHON}" "${BUILD_DIR}"/lib/pytest.py \
54 || die "tests failed with ${EPYTHON}"
58 python_install_all() {
59 use doc && dohtml -r doc/en/_build/html/
60 distutils-r1_python_install_all