dev-python/pytest: keyworded 4.6.10 for sparc, bug #707350
[gentoo.git] / dev-python / pytest / pytest-4.6.10.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 DISTUTILS_USE_SETUPTOOLS=rdepend
7 PYTHON_COMPAT=( python2_7 python3_{6,7,8,9} pypy3 )
8
9 inherit distutils-r1
10
11 DESCRIPTION="Simple powerful testing with Python"
12 HOMEPAGE="http://pytest.org/"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
14
15 LICENSE="MIT"
16 SLOT="0"
17 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
18 IUSE="test"
19 RESTRICT="!test? ( test )"
20
21 # When bumping, please check setup.py for the proper py version
22 PY_VER="1.5.0"
23
24 # pathlib2 has been added to stdlib before py3.6, but pytest needs __fspath__
25 # support, which only came in py3.6.
26 RDEPEND="
27         >=dev-python/atomicwrites-1.0[${PYTHON_USEDEP}]
28         >=dev-python/attrs-17.4.0[${PYTHON_USEDEP}]
29         >=dev-python/more-itertools-4.0.0[${PYTHON_USEDEP}]
30         $(python_gen_cond_dep '
31                 dev-python/importlib_metadata[${PYTHON_USEDEP}]
32         ' -2 python3_{5,6,7} pypy3)
33         $(python_gen_cond_dep '
34                 dev-python/pathlib2[${PYTHON_USEDEP}]
35                 dev-python/funcsigs[${PYTHON_USEDEP}]
36         ' -2)
37         >=dev-python/pluggy-0.12[${PYTHON_USEDEP}]
38         <dev-python/pluggy-1
39         >=dev-python/py-${PY_VER}[${PYTHON_USEDEP}]
40         dev-python/packaging[${PYTHON_USEDEP}]
41         dev-python/six[${PYTHON_USEDEP}]
42         dev-python/wcwidth[${PYTHON_USEDEP}]"
43
44 # flake cause a number of tests to fail
45 DEPEND="
46         test? (
47                 ${RDEPEND}
48                 dev-python/argcomplete[${PYTHON_USEDEP}]
49                 >=dev-python/hypothesis-3.56[${PYTHON_USEDEP}]
50                 dev-python/nose[${PYTHON_USEDEP}]
51                 dev-python/pexpect[${PYTHON_USEDEP}]
52                 dev-python/pytest-xdist[${PYTHON_USEDEP}]
53                 dev-python/requests[${PYTHON_USEDEP}]
54                 !!dev-python/flaky
55                 !!dev-python/pytest-aiohttp
56                 !!dev-python/pytest-asyncio
57                 !!dev-python/pytest-django
58                 $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' -2)
59         )"
60
61 PATCHES=(
62         "${FILESDIR}/${PN}-4.5.0-strip-setuptools_scm.patch"
63 )
64
65 python_prepare_all() {
66         grep -qF "py>=${PY_VER}" setup.py || die "Incorrect dev-python/py dependency"
67
68         # Something in the ebuild environment causes this to hang/error.
69         # https://bugs.gentoo.org/598442
70         rm testing/test_pdb.py || die
71
72         distutils-r1_python_prepare_all
73 }
74
75 python_test() {
76         distutils_install_for_testing
77
78         # In v4.1.1, pytest started being picky about its own verbosity options.
79         # running pytest on itself with -vv made 3 tests fail. This is why we don't
80         # have it below.
81         "${EPYTHON}" "${BUILD_DIR}"/lib/pytest.py --lsof -rfsxX \
82                 || die "tests failed with ${EPYTHON}"
83 }