dev-python/mock: bump to 4.0.2

Closes: https://bugs.gentoo.org/758482
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James
2020-12-05 23:48:31 +00:00
parent e76c7fd2e0
commit b7a6f93e16
2 changed files with 51 additions and 0 deletions

View File

@@ -1 +1,2 @@
DIST mock-3.0.5.gh.tar.gz 67887 BLAKE2B b9c49b3627275889d73aff9ea9c7925093f9cafb304448b2f06eda2fff26152a031aafb4844537e4d58bc112709e59a44e08d32602776386a30d039743def29c SHA512 9ab4f0c794f5701ba1367d982cf79a5662d4233753d12ed9c88ae20282db1f44be73f84c4d9f6d03ff64926b8c1b6d0c9a79b2a4724a3eb36c247ffd4ab03e2d
DIST mock-4.0.2.gh.tar.gz 79450 BLAKE2B 529d8564a8f236b428745838fbc3bfd1cfc540a5feb5527653b7d4becb6ff118056bb301cb186964570c50588b42b7be22338c8c2b844c932284fdc359648add SHA512 348b67a62d1937de1778e3030fb4940bb11c58e839d212a75924aa94ed9a993b47b04612de92f073ec3fe4af4be15468e843f70a2d94bb31edb0a4c57cb46cc6

View File

@@ -0,0 +1,50 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8,9} pypy3 )
inherit distutils-r1
DESCRIPTION="Rolling backport of unittest.mock for all Pythons"
HOMEPAGE="https://github.com/testing-cabal/mock"
SRC_URI="https://github.com/testing-cabal/mock/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-macos"
RDEPEND="
$(python_gen_cond_dep '
dev-python/funcsigs[${PYTHON_USEDEP}]
' -2)
>=dev-python/six-1.9[${PYTHON_USEDEP}]"
DEPEND="${RDEPEND}
>=dev-python/setuptools-17.1[${PYTHON_USEDEP}]"
python_test() {
# Upstream supports running tests only in their dream pristine
# environment. pytest doesn't work at all if mock is already
# installed. We can use plain unittest but we have to reinvent
# test filtering.
cp -r mock/tests "${BUILD_DIR}"/lib/mock/ || die
cd "${BUILD_DIR}"/lib || die
if ! python_is_python3; then
rm mock/tests/*py3* || die
fi
# https://github.com/testing-cabal/mock/commit/d6b42149bb87cf38729eef8a100c473f602ef7fa
if [[ ${EPYTHON} == pypy* ]]; then
sed -i -e 's:def test_copy:def _test_copy:' \
mock/tests/testmock.py || die
fi
"${EPYTHON}" -m unittest discover -v || die "Tests failed with ${EPYTHON}"
}
python_install_all() {
local DOCS=( CHANGELOG.rst README.rst )
distutils-r1_python_install_all
}