Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/random2/, dev-python/random2/files/
Date: Sun, 25 Oct 2020 00:28:03
Message-Id: 1603585660.49a2baca146ef87e74904a66f0f9f715822bc783.asturm@gentoo
1 commit: 49a2baca146ef87e74904a66f0f9f715822bc783
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 24 18:59:54 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 25 00:27:40 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=49a2baca
7
8 dev-python/random2: python3_9, enable tests in the first place, pass
9
10 Package-Manager: Portage-3.0.8, Repoman-3.0.2
11 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
12
13 .../random2/files/random2-1.0.1-py39-tests.patch | 32 ++++++++++++++++++++++
14 dev-python/random2/random2-1.0.1-r1.ebuild | 7 ++++-
15 2 files changed, 38 insertions(+), 1 deletion(-)
16
17 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
18 new file mode 100644
19 index 00000000000..48317af2f25
20 --- /dev/null
21 +++ b/dev-python/random2/files/random2-1.0.1-py39-tests.patch
22 @@ -0,0 +1,32 @@
23 +From a60d5ce10e5df0cebd7e7de0bff6f291bf9403ca Mon Sep 17 00:00:00 2001
24 +From: Andreas Sturmlechner <asturm@g.o>
25 +Date: Sat, 24 Oct 2020 20:57:00 +0200
26 +Subject: [PATCH] getrandbits() accepts 0 in python3_9
27 +
28 +---
29 + src/tests.py | 2 --
30 + 1 file changed, 2 deletions(-)
31 +
32 +diff --git a/src/tests.py b/src/tests.py
33 +index d918891..6f600ab 100644
34 +--- a/src/tests.py
35 ++++ b/src/tests.py
36 +@@ -291,7 +291,6 @@ class SystemRandom_TestBasicOps(TestBasicOps):
37 + # Verify argument checking
38 + self.assertRaises(TypeError, self.gen.getrandbits)
39 + self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
40 +- self.assertRaises(ValueError, self.gen.getrandbits, 0)
41 + self.assertRaises(ValueError, self.gen.getrandbits, -1)
42 + self.assertRaises(TypeError, self.gen.getrandbits, 10.1)
43 +
44 +@@ -448,7 +447,6 @@ class MersenneTwister_TestBasicOps(TestBasicOps):
45 + self.assertRaises(TypeError, self.gen.getrandbits)
46 + self.assertRaises(TypeError, self.gen.getrandbits, 'a')
47 + self.assertRaises(TypeError, self.gen.getrandbits, 1, 2)
48 +- self.assertRaises(ValueError, self.gen.getrandbits, 0)
49 + self.assertRaises(ValueError, self.gen.getrandbits, -1)
50 +
51 + def test_randbelow_logic(self, _log=log, int=int):
52 +--
53 +2.29.1
54 +
55
56 diff --git a/dev-python/random2/random2-1.0.1-r1.ebuild b/dev-python/random2/random2-1.0.1-r1.ebuild
57 index 0599ef488cd..6eb84a53956 100644
58 --- a/dev-python/random2/random2-1.0.1-r1.ebuild
59 +++ b/dev-python/random2/random2-1.0.1-r1.ebuild
60 @@ -3,15 +3,20 @@
61
62 EAPI=7
63
64 -PYTHON_COMPAT=( python3_{6,7,8} )
65 +PYTHON_COMPAT=( python3_{6,7,8,9} )
66 inherit distutils-r1
67
68 DESCRIPTION="Python-2.7 random module ported to python-3"
69 HOMEPAGE="https://pypi.org/project/random2/"
70 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.zip"
71 +
72 LICENSE="PSF-2"
73 SLOT="0"
74 KEYWORDS="amd64 arm64 x86"
75
76 BDEPEND="app-arch/unzip
77 dev-python/setuptools[${PYTHON_USEDEP}]"
78 +
79 +distutils_enable_tests setup.py
80 +
81 +PATCHES=( "${FILESDIR}/${P}-py39-tests.patch" )