diff options
author | Sebastian Pipping <sping@gentoo.org> | 2023-02-11 02:09:36 +0100 |
---|---|---|
committer | Sebastian Pipping <sping@gentoo.org> | 2023-02-11 02:13:26 +0100 |
commit | c1b832af4ea9449535df0dae87b7ebc92d434ada (patch) | |
tree | 8250edf9da4cf5b18dad8236d3463ac1780d8db3 /dev-python/doublex | |
parent | sys-libs/compiler-rt-sanitizers: CLANG_NO_DEFAULT_CONFIG workaround for <16 (diff) | |
download | gentoo-c1b832af4ea9449535df0dae87b7ebc92d434ada.tar.gz gentoo-c1b832af4ea9449535df0dae87b7ebc92d434ada.tar.bz2 gentoo-c1b832af4ea9449535df0dae87b7ebc92d434ada.zip |
dev-python/doublex: 1.9.5.1
Also EAPI 8, Python 3.11, make tests work without dev-python/nose,
and address DistutilsNonPEP517Build
Bug: https://bugs.gentoo.org/888247
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
Diffstat (limited to 'dev-python/doublex')
-rw-r--r-- | dev-python/doublex/Manifest | 1 | ||||
-rw-r--r-- | dev-python/doublex/doublex-1.9.5.1.ebuild | 59 | ||||
-rw-r--r-- | dev-python/doublex/files/doublex-1.9.5.1-py310.patch | 29 |
3 files changed, 89 insertions, 0 deletions
diff --git a/dev-python/doublex/Manifest b/dev-python/doublex/Manifest index 808466437d18..bf5a43b36bb0 100644 --- a/dev-python/doublex/Manifest +++ b/dev-python/doublex/Manifest @@ -1 +1,2 @@ DIST doublex-1.9.2.tar.gz 80246 BLAKE2B 7fc1c4e6d117bee13e7125b634293aa7c9d1016c9cd5201f047143bcb1fae1e9607bf0a030cbaa2d6eb930474babe29aaf244433aba57ae4325a3a43af2fdf56 SHA512 0278f756930b0d5c3da676e3908ccc17b919c14f740aace3002f5117fa341ac52fe16fdaa2c3b36029757dd1dc2f36d8d35cdc8664fcfdbcafd4809d2fc969b0 +DIST doublex-1.9.5.1.tar.gz 80508 BLAKE2B 3c3e233bbe4fcc3a122430bfb826ab9824d41472e80802f0e6d345da83cbe97bb33912a831bead550299942b0087063e86839f6bf3a29a08164b6e3bf641f437 SHA512 498e8a8076ed7d3585aae7a20edf54d4143e6875cd8e7af3b47f9f9cfc612a5217d7877092c2af7f1ac80c7aad7be89946671a836fc5817de06ec541c0cb1e06 diff --git a/dev-python/doublex/doublex-1.9.5.1.ebuild b/dev-python/doublex/doublex-1.9.5.1.ebuild new file mode 100644 index 000000000000..cb7f59b841d4 --- /dev/null +++ b/dev-python/doublex/doublex-1.9.5.1.ebuild @@ -0,0 +1,59 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} ) +DISTUTILS_USE_PEP517=setuptools + +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}] ) +" + +PATCHES=( + # https://github.com/davidvilla/python-doublex/commit/425807d7276dcea0e0640384d65aeb15184c508c + "${FILESDIR}/${P}-py310.patch" +) + +distutils_enable_tests pytest + +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" +} + +python_test() { + epytest -o 'python_files=*_tests.py' +} diff --git a/dev-python/doublex/files/doublex-1.9.5.1-py310.patch b/dev-python/doublex/files/doublex-1.9.5.1-py310.patch new file mode 100644 index 000000000000..e4aa9153115e --- /dev/null +++ b/dev-python/doublex/files/doublex-1.9.5.1-py310.patch @@ -0,0 +1,29 @@ +From b76a792b48109f1a10f460878fbe0fd78c41cd93 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebastian@pipping.org> +Date: Sat, 11 Feb 2023 02:00:46 +0100 +Subject: [PATCH] Fix import to collections.abc.Callable for Python >=3.10 + +Subset of this post-1.9.5.1 upstream commit: +https://github.com/davidvilla/python-doublex/commit/425807d7276dcea0e0640384d65aeb15184c508c +--- + doublex/internal.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/doublex/internal.py b/doublex/internal.py +index a85da9f..e5b25cb 100644 +--- a/doublex/internal.py ++++ b/doublex/internal.py +@@ -24,8 +24,8 @@ import threading + import functools + import six + +-if sys.version_info < (3, 3): +- from collection.abc import Callable as abc_Callable, Mapping as abc_Mapping ++if sys.version_info > (3, 3): ++ from collections.abc import Callable as abc_Callable, Mapping as abc_Mapping + else: + from collections import Callable as abc_Callable, Mapping as abc_Mapping + +-- +2.39.1 + |