+DIST contextlib2-0.6.0.post1.tar.gz 29670 BLAKE2B 927cbc674c2cb568e71bd110773bea6f848233928bb910e0db7114812b3359b9395e43c01be1645d44f3202f94c62bc21c4db883a155c64feb636a61865dd7d8 SHA512 bd3b458b365bc1d556476f6368bc523fde07e85afdad74037aa98d7a498008103a789f6b481b606700da92606ee6477fc5a817f1596e93a6e3c548ed0d4a5bf8
DIST contextlib2-0.6.0.tar.gz 29607 BLAKE2B 674d0ed2cb71837ec8bed46b44790c31601347e315abb3ab666aac3a7754f07602bbc4f1591a8c905e02949ed9178fb6230f600ca35d244b83353286901510e2 SHA512 01901ac226c7fca40add00e95cedb2535a802e0114a53ae1315c6dfee20744dbafa7d9619986ad76345ad9b9aa3e364ac01d23f51b5eb70dd2febd5af1f1fc56
--- /dev/null
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python{2_7,3_{6,7,8}} pypy3 )
+
+inherit distutils-r1
+
+MY_P="${PN}-${PV/_p/.post}"
+DESCRIPTION="Backports and enhancements for the contextlib module"
+HOMEPAGE="https://pypi.org/project/contextlib2/"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
+
+LICENSE="PSF-2.4"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86"
+IUSE="test"
+
+DEPEND="
+ dev-python/setuptools[${PYTHON_USEDEP}]
+ test? ( $(python_gen_cond_dep '
+ dev-python/unittest2[${PYTHON_USEDEP}]
+ ' python2_7 pypy3
+ )
+ )
+"
+
+S="${WORKDIR}"/${MY_P}
+
+RESTRICT="!test? ( test )"
+
+DOCS=( NEWS.rst README.rst )
+
+python_prepare_all() {
+ sed -i -e 's:unittest.main():unittest.main(verbosity=2):' \
+ test_contextlib2.py || die
+
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ "${PYTHON}" test_contextlib2.py || die "Tests fail for ${EPYTHON}"
+}