1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( pypy3 python{2_7,3_{6,7,8}} )
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}"
18 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86"
20 RESTRICT="!test? ( test )"
23 dev-python/importlib_metadata[${PYTHON_USEDEP}]
24 >=dev-python/namespace-jaraco-2[${PYTHON_USEDEP}]
25 >=dev-python/six-1.4[${PYTHON_USEDEP}]
28 dev-python/setuptools[${PYTHON_USEDEP}]
31 >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
35 distutils_enable_sphinx docs \
36 ">=dev-python/rst-linker-1.9"
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:]]*::" \
44 distutils-r1_python_prepare_all
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}"
55 # https://wiki.gentoo.org/wiki/Project:Python/Namespace_packages#File_collisions_between_pkgutil-style_packages
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