summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-10-24 20:59:54 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-10-25 02:27:40 +0200
commit49a2baca146ef87e74904a66f0f9f715822bc783 (patch)
treec61e649cb6bc4366486bba911aead6a5f40bc736
parentapp-admin/system-config-printer: EAPI-7 bump, gnome2-- (diff)
downloadgentoo-49a2baca146ef87e74904a66f0f9f715822bc783.tar.gz
gentoo-49a2baca146ef87e74904a66f0f9f715822bc783.tar.bz2
gentoo-49a2baca146ef87e74904a66f0f9f715822bc783.zip
dev-python/random2: python3_9, enable tests in the first place, pass
Package-Manager: Portage-3.0.8, Repoman-3.0.2 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r--dev-python/random2/files/random2-1.0.1-py39-tests.patch32
-rw-r--r--dev-python/random2/random2-1.0.1-r1.ebuild7
2 files changed, 38 insertions, 1 deletions
diff --git a/dev-python/random2/files/random2-1.0.1-py39-tests.patch b/dev-python/random2/files/random2-1.0.1-py39-tests.patch
new file mode 100644
index 00000000000..48317af2f25
--- /dev/null
+++ b/dev-python/random2/files/random2-1.0.1-py39-tests.patch
@@ -0,0 +1,32 @@
+From a60d5ce10e5df0cebd7e7de0bff6f291bf9403ca Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Sat, 24 Oct 2020 20:57:00 +0200
+Subject: [PATCH] getrandbits() accepts 0 in python3_9
+
+---
+ src/tests.py | 2 --
+ 1 file changed, 2 deletions(-)
+
+diff --git a/src/tests.py b/src/tests.py
+index d918891..6f600ab 100644
+--- a/src/tests.py
++++ b/src/tests.py
+@@ -291,7 +291,6 @@ class SystemRandom_TestBasicOps(TestBasicOps):
+ # Verify argument checking
+ self.assertRaises(TypeError, self.gen.getrandbits)
+ self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+- self.assertRaises(ValueError, self.gen.getrandbits, 0)
+ self.assertRaises(ValueError, self.gen.getrandbits, -1)
+ self.assertRaises(TypeError, self.gen.getrandbits, 10.1)
+
+@@ -448,7 +447,6 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
+ self.assertRaises(TypeError, self.gen.getrandbits)
+ self.assertRaises(TypeError, self.gen.getrandbits, 'a')
+ self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
+- self.assertRaises(ValueError, self.gen.getrandbits, 0)
+ self.assertRaises(ValueError, self.gen.getrandbits, -1)
+
+ def test_randbelow_logic(self, _log=log, int=int):
+--
+2.29.1
+
diff --git a/dev-python/random2/random2-1.0.1-r1.ebuild b/dev-python/random2/random2-1.0.1-r1.ebuild
index 0599ef488cd..6eb84a53956 100644
--- a/dev-python/random2/random2-1.0.1-r1.ebuild
+++ b/dev-python/random2/random2-1.0.1-r1.ebuild
@@ -3,15 +3,20 @@
EAPI=7
-PYTHON_COMPAT=( python3_{6,7,8} )
+PYTHON_COMPAT=( python3_{6,7,8,9} )
inherit distutils-r1
DESCRIPTION="Python-2.7 random module ported to python-3"
HOMEPAGE="https://pypi.org/project/random2/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"
+
LICENSE="PSF-2"
SLOT="0"
KEYWORDS="amd64 arm64 x86"
BDEPEND="app-arch/unzip
dev-python/setuptools[${PYTHON_USEDEP}]"
+
+distutils_enable_tests setup.py
+
+PATCHES=( "${FILESDIR}/${P}-py39-tests.patch" )