From 814f4cf860e299a046b649eaee5463427984c09c Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 8 Jul 2021 15:03:58 +0100 Subject: gentoo resync : 08.07.2021 --- dev-python/testtools/Manifest | 4 +- .../files/testtools-2.4.0-assertitemsequal.patch | 27 ++++++++++ .../testtools/files/testtools-2.4.0-py310.patch | 43 ++++++++++++++++ dev-python/testtools/testtools-2.4.0-r1.ebuild | 45 ---------------- dev-python/testtools/testtools-2.4.0-r2.ebuild | 60 ++++++++++++++++++++++ 5 files changed, 133 insertions(+), 46 deletions(-) create mode 100644 dev-python/testtools/files/testtools-2.4.0-assertitemsequal.patch create mode 100644 dev-python/testtools/files/testtools-2.4.0-py310.patch delete mode 100644 dev-python/testtools/testtools-2.4.0-r1.ebuild create mode 100644 dev-python/testtools/testtools-2.4.0-r2.ebuild (limited to 'dev-python/testtools') diff --git a/dev-python/testtools/Manifest b/dev-python/testtools/Manifest index 91032077a23f..fd3c3b3c45e0 100644 --- a/dev-python/testtools/Manifest +++ b/dev-python/testtools/Manifest @@ -1,4 +1,6 @@ +AUX testtools-2.4.0-assertitemsequal.patch 869 BLAKE2B b7fe42aa06c20c0c281d275530b64480d69b0d4b569c9d785edffa66d8d47422777fbd98aeb49e1ab96a4126672750d0b639812db3fff1c39370d8fb20f390ca SHA512 4481ab0fd5d0c3d15b1a8e50166d5d9a850126b1aca9b945f29d0ca4504e2f31528985d251058049973dec63f5dbca217963cb0047d14f447620b85a188545e1 +AUX testtools-2.4.0-py310.patch 1325 BLAKE2B 3b7f3b370d2ce5b98e2a80ca438eaba4a224bcbde0c5f4307baaa5faf1b35f8dddf77b5fca8b45c6870910fbb784ab064c0178f8d77d7cd644c44ca94f2bd62b SHA512 bc96d58c2dd1744a7381d1418a000f213ce2c9253d54ed63fb11e686d05d684edb9e2873f0b15b7b99d5ae3deb1d435e4512ece1d1bad96947cc6654a7e6ad13 AUX testtools-2.4.0-py39.patch 4816 BLAKE2B dc5198c0c8baab37ae645d97cb93c860e737142b691d00f96e35574dd0e77f8a163d4031a4b96aa9f28664af1a3a58552565bf5d887cef00c72e13ba9c3b3ea9 SHA512 a554d49e74f43269a847d767611f86fda655fe9ca27cf182c91975702b6928b4161e12d78283113b88b4d50b9fce240cd4fbf236e884e8b92698bdd512c42598 DIST testtools-2.4.0.tar.gz 233032 BLAKE2B 8b0559039bfc5e18dfe8d70cc10f6e43ad2e1fbebf7d20d9c6c876c5672a6149064f558150d8eb09f569b82983ffe67e06143b14a1d8869efcc585839d6216ae SHA512 af26e163a4caeb207a554b19f86c7892ab5ebe904c144d85273464e880cd18a991c70a77ff817aefb15768fa38f382e9ed853cdefb212dc697b24072e17535c0 -EBUILD testtools-2.4.0-r1.ebuild 1258 BLAKE2B 77283b33088785e30ae29db540d5ff1d82f3d69f8988558471eff5b2997e7d7c9f6cc92ce1d5ce2f3588ec939d77a191e07177c74a99191ebdb3302c380cb954 SHA512 12cec53f1fd22cf6ea44738f3237b5904960ef6afc1b290261efb4725c51041c55de1f98848dcab705de2a642a0636dacd988a1a5f6ea319bc5db77e2b1c8c3d +EBUILD testtools-2.4.0-r2.ebuild 1714 BLAKE2B 605564e5cc81276e89709b78fc7c84ee6df8575b25ca7ed539b344fa6db5e8bda8443c35870087db10512d91e3303460fc6e84ac76ad472a3c8d77b24cacfb5c SHA512 ac5d3f78bc3c6909c1e719fbeaaabb5c89955c5680aa5311b73e1cae56ad20b9da3fe90085bbaf632bf77b841d91cb2bd3493f2e0262cce240ffcee76a3bd80d MISC metadata.xml 579 BLAKE2B 60320e15f2101c115cbd946efe6a2c8cfc12645a005bb9727f5c4fb7d28d91081f2b96b6120ad9a36a7bb6af61d7110afb97b7985306dea3d57427af834a8112 SHA512 c3c8805d1a8d7cc406104548d1d89ce8074ef989a623b5190da1cc1bbe9ecb8e6f181a6c05e5c74b87bc3a3fc27c6713642070f34d4961e385a470820ceda0f0 diff --git a/dev-python/testtools/files/testtools-2.4.0-assertitemsequal.patch b/dev-python/testtools/files/testtools-2.4.0-assertitemsequal.patch new file mode 100644 index 000000000000..e46bf29c8bfc --- /dev/null +++ b/dev-python/testtools/files/testtools-2.4.0-assertitemsequal.patch @@ -0,0 +1,27 @@ +From 2ead7c11a54b0860e02992212e302c4a7bd26c35 Mon Sep 17 00:00:00 2001 +From: Matthew Treinish +Date: Wed, 8 Jul 2020 14:22:24 -0400 +Subject: [PATCH] Update testtools/testcase.py + +Co-authored-by: Thomas Grainger +--- + testtools/testcase.py | 1 + + 1 file changed, 1 insertion(+) + +Rebased for 2.4.0 by Michał Górny (eliminating intermediate commits). + +diff --git a/testtools/testcase.py b/testtools/testcase.py +index bff5be2..22e9143 100644 +--- a/testtools/testcase.py ++++ b/testtools/testcase.py +@@ -501,6 +501,7 @@ class TestCase(unittest.TestCase): + if mismatch_error is not None: + raise mismatch_error + ++ assertItemsEqual = unittest.TestCase.assertCountEqual + def addDetailUniqueName(self, name, content_object): + """Add a detail to the test, but ensure it's name is unique. + +-- +2.32.0 + diff --git a/dev-python/testtools/files/testtools-2.4.0-py310.patch b/dev-python/testtools/files/testtools-2.4.0-py310.patch new file mode 100644 index 000000000000..d2d0c092d14a --- /dev/null +++ b/dev-python/testtools/files/testtools-2.4.0-py310.patch @@ -0,0 +1,43 @@ +From d528842b99b16efce212e15dae3f0a54927d06d8 Mon Sep 17 00:00:00 2001 +From: Cyril Roelandt +Date: Fri, 19 Mar 2021 02:50:13 +0000 +Subject: [PATCH] Fix tests with Python 3.10 + +In Python 3, error messages have become a bit more precise. For +instance, the following code snippet: + +---- +class Foo(): + def bar(self, a): + pass + +try: + Foo().bar(1, 2) +except TypeError as e: + print(e) +---- + +will return: + +- in Python 3.9: "bar() takes 2 positional arguments but 3 were given" +- in Python 3.10: "Foo.bar() takes 2 positional arguments but 3 were + given" + +Fix our tests accordingly. +--- + testtools/tests/test_testsuite.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/testtools/tests/test_testsuite.py b/testtools/tests/test_testsuite.py +index 7ad5b74d..65cb88d7 100644 +--- a/testtools/tests/test_testsuite.py ++++ b/testtools/tests/test_testsuite.py +@@ -181,7 +181,7 @@ def run(self): + test.run(process_result) + """, doctest.ELLIPSIS)) + self.assertThat(events[3][6].decode('utf8'), DocTestMatches("""\ +-TypeError: run() takes ...1 ...argument...2...given... ++TypeError: ...run() takes ...1 ...argument...2...given... + """, doctest.ELLIPSIS)) + events = [event[0:10] + (None,) for event in events] + events[1] = events[1][:6] + (None,) + events[1][7:] diff --git a/dev-python/testtools/testtools-2.4.0-r1.ebuild b/dev-python/testtools/testtools-2.4.0-r1.ebuild deleted file mode 100644 index 7ac7bd38f4e7..000000000000 --- a/dev-python/testtools/testtools-2.4.0-r1.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{8..9} pypy3 ) -PYTHON_REQ_USE="threads(+)" - -inherit distutils-r1 - -DESCRIPTION="Extensions to the Python standard library unit testing framework" -HOMEPAGE="https://github.com/testing-cabal/testtools" -SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos" - -RDEPEND=" - >=dev-python/extras-1.0.0[${PYTHON_USEDEP}] - dev-python/python-mimeparse[${PYTHON_USEDEP}] - >=dev-python/pbr-0.11[${PYTHON_USEDEP}] - dev-python/pyrsistent[${PYTHON_USEDEP}] - >=dev-python/six-1.4.0[${PYTHON_USEDEP}] - dev-python/traceback2[${PYTHON_USEDEP}] - >=dev-python/unittest2-1.0.0[${PYTHON_USEDEP}] -" -DEPEND=" - test? ( - >=dev-python/fixtures-1.3.0[${PYTHON_USEDEP}] - dev-python/testscenarios[${PYTHON_USEDEP}] - ) -" -PDEPEND=">=dev-python/fixtures-1.3.0[${PYTHON_USEDEP}]" - -PATCHES=( - "${FILESDIR}"/testtools-2.4.0-py39.patch -) - -distutils_enable_sphinx doc -distutils_enable_tests unittest - -python_test() { - "${PYTHON}" -m testtools.run testtools.tests.test_suite || die "tests failed under ${EPYTHON}" -} diff --git a/dev-python/testtools/testtools-2.4.0-r2.ebuild b/dev-python/testtools/testtools-2.4.0-r2.ebuild new file mode 100644 index 000000000000..fdc73ff2db99 --- /dev/null +++ b/dev-python/testtools/testtools-2.4.0-r2.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{8..10} pypy3 ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="Extensions to the Python standard library unit testing framework" +HOMEPAGE="https://github.com/testing-cabal/testtools" +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~x64-macos" + +RDEPEND=" + >=dev-python/extras-1.0.0[${PYTHON_USEDEP}] + dev-python/python-mimeparse[${PYTHON_USEDEP}] + >=dev-python/pbr-0.11[${PYTHON_USEDEP}] + dev-python/pyrsistent[${PYTHON_USEDEP}] + >=dev-python/six-1.4.0[${PYTHON_USEDEP}] +" +DEPEND=" + test? ( + >=dev-python/fixtures-1.3.0[${PYTHON_USEDEP}] + dev-python/testscenarios[${PYTHON_USEDEP}] + ) +" +PDEPEND=">=dev-python/fixtures-1.3.0[${PYTHON_USEDEP}]" + +PATCHES=( + "${FILESDIR}"/testtools-2.4.0-py39.patch + "${FILESDIR}"/testtools-2.4.0-py310.patch + "${FILESDIR}"/testtools-2.4.0-assertitemsequal.patch +) + +distutils_enable_sphinx doc +distutils_enable_tests unittest + +src_prepare() { + # eliminate unittest2 & traceback2 + sed -i -e '/unittest2/d' -e '/traceback2/d' requirements.txt || die + # also conditional imports + find -name '*.py' -exec \ + sed -i -e 's:unittest2:unittest:' {} + || die + sed -i -e 's/^traceback =.*/import traceback/' \ + testtools/content.py || die + # py3.10 changed the output + sed -i -e 's:test_syntax_error:_&:' \ + testtools/tests/test_testresult.py || die + distutils-r1_src_prepare +} + +python_test() { + "${PYTHON}" -m testtools.run testtools.tests.test_suite || + die "tests failed under ${EPYTHON}" +} -- cgit v1.2.3