sys-apps/groff: stable 1.22.4 for hppa, bug #704420
[gentoo.git] / dev-python / jaraco-packaging / jaraco-packaging-6.2-r1.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 PYTHON_COMPAT=( pypy3 python{2_7,3_{6,7,8}} )
7
8 inherit distutils-r1
9
10 MY_PN="${PN/-/.}"
11 DESCRIPTION="Tools to supplement packaging Python releases"
12 HOMEPAGE="https://github.com/jaraco/jaraco.packaging"
13 SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
14 S="${WORKDIR}/${MY_PN}-${PV}"
15
16 LICENSE="MIT"
17 SLOT="0"
18 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86"
19 IUSE="test"
20 RESTRICT="!test? ( test )"
21
22 RDEPEND="
23         dev-python/importlib_metadata[${PYTHON_USEDEP}]
24         >=dev-python/namespace-jaraco-2[${PYTHON_USEDEP}]
25         >=dev-python/six-1.4[${PYTHON_USEDEP}]
26 "
27 DEPEND="
28         dev-python/setuptools[${PYTHON_USEDEP}]
29         test? (
30                 ${RDEPEND}
31                 >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
32         )
33 "
34
35 distutils_enable_sphinx docs \
36         ">=dev-python/rst-linker-1.9"
37
38 python_prepare_all() {
39         # avoid a setuptools_scm dependency
40         sed -i "s:use_scm_version=True:version='${PV}',name='${PN//-/.}':" setup.py || die
41         sed -r -i "s:setuptools_scm[[:space:]]*([><=]{1,2}[[:space:]]*[0-9.a-zA-Z]+)[[:space:]]*::" \
42                 setup.cfg || die
43
44         distutils-r1_python_prepare_all
45 }
46
47 python_test() {
48         # Skip one test which requires network access
49         # Override pytest options to skip flake8
50         PYTHONPATH=. pytest -vv -k "not test_revived_distribution" \
51                 --override-ini="addopts=--doctest-modules" \
52                 || die "tests failed with ${EPYTHON}"
53 }
54
55 # https://wiki.gentoo.org/wiki/Project:Python/Namespace_packages#File_collisions_between_pkgutil-style_packages
56 python_install() {
57         rm "${BUILD_DIR}"/lib/jaraco/__init__.py || die
58         # note: eclass may default to --skip-build in the future
59         distutils-r1_python_install --skip-build
60 }