Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/flexmock/, dev-python/flexmock/files/
Date: Sat, 25 Sep 2021 22:03:41
Message-Id: 1632607286.5f5176fe3da027123bc6419b6fb30a1851bab694.mgorny@gentoo
1 commit: 5f5176fe3da027123bc6419b6fb30a1851bab694
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Sep 25 22:01:26 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Sep 25 22:01:26 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f5176fe
7
8 dev-python/flexmock: Remove old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/flexmock/Manifest | 3 --
13 ...ock-0.10.6-fix-with_args-sys.stdout.write.patch | 60 ----------------------
14 dev-python/flexmock/flexmock-0.10.4.ebuild | 23 ---------
15 dev-python/flexmock/flexmock-0.10.6.ebuild | 31 -----------
16 dev-python/flexmock/flexmock-0.10.8.ebuild | 27 ----------
17 5 files changed, 144 deletions(-)
18
19 diff --git a/dev-python/flexmock/Manifest b/dev-python/flexmock/Manifest
20 index e0f55197969..0325d3417ee 100644
21 --- a/dev-python/flexmock/Manifest
22 +++ b/dev-python/flexmock/Manifest
23 @@ -1,5 +1,2 @@
24 DIST flexmock-0.10.10.tar.gz 49201 BLAKE2B f5d77398ac14a002f78790d4e03f93bcd00c016e6a5eb0be45ce3b59a223159656ab694a1dd1124cbac351680fef25084d69e9533d668177ea73b9e458df5b6f SHA512 211939bf40ecb25981a70d5bfe897ef8127ef38d5adf6a48b086c4b6f49b05e1a04f09afb73f428e3eb21a8090ba33ca86e605c2c1ac70d9fc269fdd640ccb73
25 -DIST flexmock-0.10.4.tar.gz 45362 BLAKE2B 4ff79cff3b0d8fb0c97bd60b0d5aa5555a7b939d3d6275a17c9bd1002b1d7acb53d4f63f5f834faf0d349d8b8d429eb063f121c4d7b6d12aa1bb3e7bdbadb861 SHA512 d190fcb66f0c2c4e3be2384d68b95a22c695ffa0fe8f8a218f2baa68c91683641396197cac69ddab21e4b0990b9930f56423bb7cd85770ceade9c22ece72cedc
26 -DIST flexmock-0.10.6.tar.gz 46740 BLAKE2B b5c8083694e8787e85ff0f41265ad9f716a4c82d274ca5c793b6d93bf8bf28f3e57afd33f7ba59149e75f7bffbebd3843901dfa75caaefc6f76f3eef0c603314 SHA512 2ebaed78926f01bd4d886a509d978d0de04629f7d96c48f846b8ccf7906bb2303e7cbeab8226c6eb98d058f940434144cc2d6300d6aa2533f1f217788211490e
27 -DIST flexmock-0.10.8.tar.gz 46905 BLAKE2B d5f28e012edf9678fd5f72ec1d99e4e98b00dbb36536877cb393c16563097e0e3f18ab24243f7090bfa306f8be194243d201d9aaf5d64491bb594cff82b60e1e SHA512 cac327b3e3c4c6ccbcd6c7f71863b67fdd5454c13bbd5403b3ba521e3ae945ba453152df623eef08b2b60210ba626447a9e6bad76c2215281d43ae0f42ebf1a9
28 DIST flexmock-0.10.9.tar.gz 48466 BLAKE2B b6c73fdb6d281870806db7b34d43d8f116c29ff28a3753e7873868e66df9a34f8f4cfa0c1a7f1fd620a58a46b4376538a8a64994ed82d500a850f86c24fe54d2 SHA512 6e39e5a88b1d744d348f834f4664fc477412f6f09dd2500ef35a52126ce14f9e8d24a04c1ceb16c24b31bc40c3d8276f2efa75a701ecf284bb2cb5388513a75f
29
30 diff --git a/dev-python/flexmock/files/flexmock-0.10.6-fix-with_args-sys.stdout.write.patch b/dev-python/flexmock/files/flexmock-0.10.6-fix-with_args-sys.stdout.write.patch
31 deleted file mode 100644
32 index 0c3988e4178..00000000000
33 --- a/dev-python/flexmock/files/flexmock-0.10.6-fix-with_args-sys.stdout.write.patch
34 +++ /dev/null
35 @@ -1,60 +0,0 @@
36 -From 020ebef66523e9496f8042beb9384f3f770a6412 Mon Sep 17 00:00:00 2001
37 -From: Arthur Zamarin <arthurzam@g.o>
38 -Date: Thu, 19 Aug 2021 20:39:04 +0300
39 -Subject: [PATCH] Fix with_args not working with sys.stdout.write
40 -
41 -https://github.com/flexmock/flexmock/commit/513265e731fc4daceeb19123a4e71d652b990a1a
42 -
43 -Backported to 0.10.6 by Arthur Zamarin <arthurzam@g.o>
44 -
45 ---- a/flexmock.py
46 -+++ b/flexmock.py
47 -@@ -254,13 +254,13 @@ class Expectation(object):
48 - # - it's not a static method
49 - # - the mocked object is a module - module "methods" are in fact plain functions;
50 - # unless they're classes, which means they still have __init__
51 -- is_method = ((inspect.ismethod(self.original) or inspect.isfunction(self.original)
52 -- or _isclass(self.original)) and
53 -- self.method_type is not staticmethod and
54 -- (not isinstance(self._mock, types.ModuleType) or
55 -- _isclass(self.original)))
56 -+ is_builtin_method = isinstance(self.original, types.BuiltinMethodType)
57 -+ is_method = inspect.ismethod(self.original) and self.method_type is not staticmethod
58 -+ is_class = inspect.isclass(self.original)
59 -+ is_class_method = (inspect.isfunction(self.original) and inspect.isclass(self.mock)
60 -+ and self.method_type is not staticmethod)
61 - args_len = len(allowed.args)
62 -- if is_method:
63 -+ if is_builtin_method or is_method or is_class or is_class_method:
64 - args_len -= 1
65 - minimum = args_len - (allowed.defaults and len(allowed.defaults) or 0)
66 - maximum = None
67 ---- a/tests/flexmock_test.py
68 -+++ b/tests/flexmock_test.py
69 -@@ -17,6 +17,7 @@ from flexmock import ReturnValue
70 - from flexmock import flexmock_teardown
71 - from flexmock import _format_args
72 - from flexmock import _isproperty
73 -+import random
74 - import flexmock
75 - import re
76 - import sys
77 -@@ -308,6 +309,15 @@ class RegularClass(object):
78 - assertEqual('got an int', mock.method_foo(23))
79 - assertRaises(MethodSignatureError, mock.method_foo, 2.0)
80 -
81 -+ def test_with_args_should_work_with_builtin_c_functions_and_methods(self):
82 -+ flexmock(sys.stdout).should_call("write") # set fall-through
83 -+ flexmock(sys.stdout).should_receive("write").with_args("flexmock_builtin_test").once()
84 -+ sys.stdout.write("flexmock_builtin_test")
85 -+
86 -+ def test_with_args_should_work_with_builtin_python_methods(self):
87 -+ flexmock(random).should_receive("randint").with_args(1, 10).once()
88 -+ random.randint(1, 10)
89 -+
90 - def test_flexmock_should_match_expectations_against_user_defined_classes(self):
91 - mock = flexmock(name='temp')
92 -
93 ---
94 -2.33.0
95 -
96
97 diff --git a/dev-python/flexmock/flexmock-0.10.4.ebuild b/dev-python/flexmock/flexmock-0.10.4.ebuild
98 deleted file mode 100644
99 index 5be99a9dfb3..00000000000
100 --- a/dev-python/flexmock/flexmock-0.10.4.ebuild
101 +++ /dev/null
102 @@ -1,23 +0,0 @@
103 -# Copyright 1999-2021 Gentoo Authors
104 -# Distributed under the terms of the GNU General Public License v2
105 -
106 -EAPI=7
107 -
108 -PYTHON_COMPAT=( python3_{8..10} pypy3 )
109 -
110 -inherit distutils-r1
111 -
112 -DESCRIPTION="Testing library to create mocks, stubs and fakes"
113 -HOMEPAGE="https://flexmock.readthedocs.org/"
114 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
115 -
116 -LICENSE="BSD"
117 -SLOT="0"
118 -KEYWORDS="amd64 ~riscv"
119 -
120 -distutils_enable_tests pytest
121 -
122 -python_install_all() {
123 - distutils-r1_python_install_all
124 - dodoc -r docs
125 -}
126
127 diff --git a/dev-python/flexmock/flexmock-0.10.6.ebuild b/dev-python/flexmock/flexmock-0.10.6.ebuild
128 deleted file mode 100644
129 index 67922e50909..00000000000
130 --- a/dev-python/flexmock/flexmock-0.10.6.ebuild
131 +++ /dev/null
132 @@ -1,31 +0,0 @@
133 -# Copyright 1999-2021 Gentoo Authors
134 -# Distributed under the terms of the GNU General Public License v2
135 -
136 -EAPI=8
137 -
138 -PYTHON_COMPAT=( python3_{8..10} pypy3 )
139 -
140 -inherit distutils-r1
141 -
142 -DESCRIPTION="Testing library to create mocks, stubs and fakes"
143 -HOMEPAGE="https://flexmock.readthedocs.org/"
144 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
145 -
146 -LICENSE="BSD"
147 -SLOT="0"
148 -KEYWORDS="~amd64 ~riscv"
149 -
150 -distutils_enable_tests pytest
151 -
152 -PATCHES=(
153 - "${FILESDIR}/${P}-fix-with_args-sys.stdout.write.patch"
154 -)
155 -
156 -python_test() {
157 - epytest -p no:flaky
158 -}
159 -
160 -python_install_all() {
161 - distutils-r1_python_install_all
162 - dodoc -r docs
163 -}
164
165 diff --git a/dev-python/flexmock/flexmock-0.10.8.ebuild b/dev-python/flexmock/flexmock-0.10.8.ebuild
166 deleted file mode 100644
167 index dd44eb32f8f..00000000000
168 --- a/dev-python/flexmock/flexmock-0.10.8.ebuild
169 +++ /dev/null
170 @@ -1,27 +0,0 @@
171 -# Copyright 1999-2021 Gentoo Authors
172 -# Distributed under the terms of the GNU General Public License v2
173 -
174 -EAPI=8
175 -
176 -PYTHON_COMPAT=( python3_{8..10} pypy3 )
177 -
178 -inherit distutils-r1
179 -
180 -DESCRIPTION="Testing library to create mocks, stubs and fakes"
181 -HOMEPAGE="https://flexmock.readthedocs.org/"
182 -SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
183 -
184 -LICENSE="BSD"
185 -SLOT="0"
186 -KEYWORDS="~amd64 ~riscv"
187 -
188 -distutils_enable_tests pytest
189 -
190 -python_test() {
191 - epytest -p no:flaky
192 -}
193 -
194 -python_install_all() {
195 - distutils-r1_python_install_all
196 - dodoc -r docs
197 -}