diff options
author | Louis Sautier <sbraz@gentoo.org> | 2021-08-07 02:02:06 +0200 |
---|---|---|
committer | Louis Sautier <sbraz@gentoo.org> | 2021-08-07 02:19:47 +0200 |
commit | 312005390767e23401501f6016ed25ffddd6d4f6 (patch) | |
tree | 39d1fa060f954843061bf6c257d5f4dd76d3b768 /dev-python/doublex | |
parent | net-vpn/ocserv: add live ebuild (diff) | |
download | gentoo-312005390767e23401501f6016ed25ffddd6d4f6.tar.gz gentoo-312005390767e23401501f6016ed25ffddd6d4f6.tar.bz2 gentoo-312005390767e23401501f6016ed25ffddd6d4f6.zip |
dev-python/doublex: enable py3.10, add missing dependency on six
Closes: https://bugs.gentoo.org/774810
Signed-off-by: Louis Sautier <sbraz@gentoo.org>
Diffstat (limited to 'dev-python/doublex')
-rw-r--r-- | dev-python/doublex/doublex-1.9.2-r1.ebuild | 55 | ||||
-rw-r--r-- | dev-python/doublex/files/doublex-1.9.2-py310.patch | 33 |
2 files changed, 88 insertions, 0 deletions
diff --git a/dev-python/doublex/doublex-1.9.2-r1.ebuild b/dev-python/doublex/doublex-1.9.2-r1.ebuild new file mode 100644 index 000000000000..a52b1c1636dd --- /dev/null +++ b/dev-python/doublex/doublex-1.9.2-r1.ebuild @@ -0,0 +1,55 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7..10} ) + +inherit distutils-r1 vcs-snapshot + +DESCRIPTION="Python test doubles" +HOMEPAGE="https://bitbucket.org/DavidVilla/python-doublex" +SRC_URI="https://bitbucket.org/DavidVilla/python-${PN}/get/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~arm64" +IUSE="doc test" + +RDEPEND=" + dev-python/pyhamcrest[${PYTHON_USEDEP}] + dev-python/six[${PYTHON_USEDEP}] +" +BDEPEND=" + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] ) + test? ( dev-python/nose[${PYTHON_USEDEP}] ) +" + +distutils_enable_tests setup.py + +PATCHES=( + # https://bitbucket.org/DavidVilla/python-doublex/pull-requests/1/support-python-310-by-using-collectionsabc + "${FILESDIR}/${P}-py310.patch" +) + +python_prepare_all() { + # Disable broken tests + # https://bitbucket.org/DavidVilla/python-doublex/issues/5/support-for-python-36-37-38-tests-failing + sed -i "s/test_*hamcrest_/_&/" doublex/test/report_tests.py || die + # https://bitbucket.org/DavidVilla/python-doublex/issues/6/more-failing-tests-with-python-39 + sed -i -r "s/test_(proxyspy_get_stubbed_property|stub_property|custom_equality_comparable_objects)/_&/" \ + doublex/test/unit_tests.py || die + distutils-r1_python_prepare_all +} + +python_compile_all() { + use doc && emake -C docs +} + +python_install_all() { + use doc && local HTML_DOCS=( docs/_build/html/. ) + + distutils-r1_python_install_all + + rm "${ED}"/usr/README.rst || die "Couldn't remove spurious README.rst" +} diff --git a/dev-python/doublex/files/doublex-1.9.2-py310.patch b/dev-python/doublex/files/doublex-1.9.2-py310.patch new file mode 100644 index 000000000000..5d3a974a38a1 --- /dev/null +++ b/dev-python/doublex/files/doublex-1.9.2-py310.patch @@ -0,0 +1,33 @@ +commit ec3ce987a95abd951840213b77d44624b2ca5e84 +Author: Louis Sautier <sautier.louis@gmail.com> +Date: Sat Aug 7 01:56:31 2021 +0200 + + Support Python 3.10 by using collections.abc + +diff --git a/doublex/internal.py b/doublex/internal.py +index 91f5866..072774a 100644 +--- a/doublex/internal.py ++++ b/doublex/internal.py +@@ -20,7 +20,7 @@ + + + import threading +-import collections ++import collections.abc + import functools + import six + +@@ -184,11 +184,11 @@ class Invocation(object): + return Invocation(double, name, InvocationContext(*args, **kargs)) + + def delegates(self, delegate): +- if isinstance(delegate, collections.Callable): ++ if isinstance(delegate, collections.abc.Callable): + self.__delegate = delegate + return + +- if isinstance(delegate, collections.Mapping): ++ if isinstance(delegate, collections.abc.Mapping): + self.__delegate = delegate.get + return + |