*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pbr / pbr-0.8.2-r1.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5
6 PYTHON_COMPAT=( python2_7 python3_6 )
7 PYTHON_REQ_USE="threads(+)"
8
9 inherit distutils-r1
10
11 DESCRIPTION="Injects some useful and sensible default behaviors into setuptools"
12 HOMEPAGE="https://github.com/openstack-dev/pbr"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
14
15 LICENSE="Apache-2.0"
16 SLOT="0"
17 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux"
18 IUSE="test"
19 RESTRICT="!test? ( test )"
20
21 DEPEND="
22         dev-python/setuptools[${PYTHON_USEDEP}]
23         test? (
24                 >=dev-python/coverage-3.6[${PYTHON_USEDEP}]
25                 >=dev-python/fixtures-0.3.14[${PYTHON_USEDEP}]
26                 >=dev-python/flake8-2.0[${PYTHON_USEDEP}]
27                 >=dev-python/mock-1.0[${PYTHON_USEDEP}]
28                 >=dev-python/subunit-0.0.18[${PYTHON_USEDEP}]
29                 >=dev-python/sphinx-1.1.2[${PYTHON_USEDEP}]
30                 dev-python/sphinx[${PYTHON_USEDEP}]
31                 >=dev-python/testrepository-0.0.18[${PYTHON_USEDEP}]
32                 >=dev-python/testresources-0.2.4[${PYTHON_USEDEP}]
33                 >=dev-python/testscenarios-0.4[${PYTHON_USEDEP}]
34                 >=dev-python/testtools-0.9.34[${PYTHON_USEDEP}]
35         )"
36 PDEPEND=">dev-python/pip-1.4[${PYTHON_USEDEP}]"
37
38 # Requ'd for testsuite
39 DISTUTILS_IN_SOURCE_BUILD=1
40
41 # This normally actually belongs here.
42 python_prepare_all() {
43         # This test passes when run within the source and doesn't represent a failure, but rather
44         # a gentoo sandbox constraint
45         # Rm tests that rely upon the package being already installed and fail
46         sed -e s':test_console_script_develop:_&:' \
47                 -e s':test_console_script_install:_&:' \
48                 -e s':test_sdist_extra_files:_&:' \
49                 -e s':test_command_hooks:_&:' \
50                 -e s':test_sdist_git_extra_files:_&:' \
51                 -i pbr/tests/test_core.py || die
52         sed -e s':test_command_hooks:_&:' \
53                 -e s':test_global_setup_hooks:_&:' \
54                 -i pbr/tests/test_hooks.py || die
55         einfo "rogue tests disabled"
56
57         distutils-r1_python_prepare_all
58 }
59
60 python_test() {
61         # Note; removed tests pass once package is emerged,
62         # it's the suite's design that breaks form, not the tests' intended purpose
63         testr init
64         testr run || die "Testsuite failed under ${EPYTHON}"
65 }