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/botocore/files/, dev-python/botocore/
Date: Thu, 30 Jun 2022 04:27:10
Message-Id: 1656563221.ad539b83f7d67a81f461535c6d8a27781584c27f.mgorny@gentoo
1 commit: ad539b83f7d67a81f461535c6d8a27781584c27f
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 30 03:56:06 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 30 04:27:01 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ad539b83
7
8 dev-python/botocore: Sync the live ebuild
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/botocore/botocore-9999.ebuild | 4 --
13 .../botocore/files/botocore-1.26.0-py311.patch | 54 ----------------------
14 2 files changed, 58 deletions(-)
15
16 diff --git a/dev-python/botocore/botocore-9999.ebuild b/dev-python/botocore/botocore-9999.ebuild
17 index 2fb86c59b25e..830c713f6036 100644
18 --- a/dev-python/botocore/botocore-9999.ebuild
19 +++ b/dev-python/botocore/botocore-9999.ebuild
20 @@ -37,10 +37,6 @@ BDEPEND="
21 )
22 "
23
24 -PATCHES=(
25 - "${FILESDIR}/botocore-1.26.0-py311.patch"
26 -)
27 -
28 distutils_enable_sphinx docs/source \
29 'dev-python/guzzle_sphinx_theme'
30 distutils_enable_tests pytest
31
32 diff --git a/dev-python/botocore/files/botocore-1.26.0-py311.patch b/dev-python/botocore/files/botocore-1.26.0-py311.patch
33 deleted file mode 100644
34 index 8caa8765c008..000000000000
35 --- a/dev-python/botocore/files/botocore-1.26.0-py311.patch
36 +++ /dev/null
37 @@ -1,54 +0,0 @@
38 -From 46a3d92e29a03f547d85861bb6e21281b6a42e60 Mon Sep 17 00:00:00 2001
39 -From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@g.o>
40 -Date: Sat, 14 May 2022 19:38:23 +0200
41 -Subject: [PATCH] Replace deprecated inspect.formatargspec() with
42 - inspect.signature()
43 -
44 -Originally submitted by Hugo van Kemenade as #2507. Modified by me
45 -to remove the first positional parameter like the old code did.
46 ----
47 - botocore/docs/method.py | 21 +++++++++++++--------
48 - 1 file changed, 13 insertions(+), 8 deletions(-)
49 -
50 -diff --git a/botocore/docs/method.py b/botocore/docs/method.py
51 -index 0f7c60f6c..44c97d6e4 100644
52 ---- a/botocore/docs/method.py
53 -+++ b/botocore/docs/method.py
54 -@@ -11,6 +11,7 @@
55 - # ANY KIND, either express or implied. See the License for the specific
56 - # language governing permissions and limitations under the License.
57 - import inspect
58 -+import types
59 -
60 - from botocore.docs.example import (
61 - RequestExampleDocumenter,
62 -@@ -101,14 +102,18 @@ def document_custom_signature(
63 - :param exclude: The names of the parameters to exclude from
64 - documentation.
65 - """
66 -- argspec = inspect.getfullargspec(method)
67 -- signature_params = inspect.formatargspec(
68 -- args=argspec.args[1:],
69 -- varargs=argspec.varargs,
70 -- varkw=argspec.varkw,
71 -- defaults=argspec.defaults,
72 -- )
73 -- signature_params = signature_params.lstrip('(')
74 -+ signature = inspect.signature(method)
75 -+ # "raw" class methods are FunctionType and they include "self" param
76 -+ # object methods are MethodType and they skip the "self" param
77 -+ if isinstance(method, types.FunctionType):
78 -+ self_param = next(iter(signature.parameters))
79 -+ self_kind = signature.parameters[self_param].kind
80 -+ # safety check that we got the right parameter
81 -+ assert self_kind == inspect.Parameter.POSITIONAL_OR_KEYWORD
82 -+ new_params = signature.parameters.copy()
83 -+ del new_params[self_param]
84 -+ signature = signature.replace(parameters=new_params.values())
85 -+ signature_params = str(signature).lstrip('(')
86 - signature_params = signature_params.rstrip(')')
87 - section.style.start_sphinx_py_method(name, signature_params)
88 -
89 ---
90 -2.35.1
91 -