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/bottle/files/, dev-python/bottle/
Date: Fri, 13 May 2022 09:08:16
Message-Id: 1652432880.37878ea5019d70e731af11167eb8c8a0542161ec.mgorny@gentoo
1 commit: 37878ea5019d70e731af11167eb8c8a0542161ec
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Fri May 13 07:50:02 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Fri May 13 09:08:00 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=37878ea5
7
8 dev-python/bottle: Enable py3.11
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/bottle/bottle-0.12.19-r1.ebuild | 3 +-
13 dev-python/bottle/files/bottle-0.12.19-py311.patch | 45 ++++++++++++++++++++++
14 2 files changed, 47 insertions(+), 1 deletion(-)
15
16 diff --git a/dev-python/bottle/bottle-0.12.19-r1.ebuild b/dev-python/bottle/bottle-0.12.19-r1.ebuild
17 index d5e33bff5880..fe4128cc4739 100644
18 --- a/dev-python/bottle/bottle-0.12.19-r1.ebuild
19 +++ b/dev-python/bottle/bottle-0.12.19-r1.ebuild
20 @@ -4,7 +4,7 @@
21 EAPI=8
22
23 DISTUTILS_USE_PEP517=setuptools
24 -PYTHON_COMPAT=( python3_{8..10} pypy3 )
25 +PYTHON_COMPAT=( python3_{8..11} pypy3 )
26
27 inherit distutils-r1 optfeature
28
29 @@ -30,6 +30,7 @@ BDEPEND="
30
31 PATCHES=(
32 "${FILESDIR}"/${PN}-0.12.8-py3.5-backport.patch
33 + "${FILESDIR}"/${P}-py311.patch
34 )
35
36 python_prepare_all() {
37
38 diff --git a/dev-python/bottle/files/bottle-0.12.19-py311.patch b/dev-python/bottle/files/bottle-0.12.19-py311.patch
39 new file mode 100644
40 index 000000000000..c7c36c3a37ee
41 --- /dev/null
42 +++ b/dev-python/bottle/files/bottle-0.12.19-py311.patch
43 @@ -0,0 +1,45 @@
44 +From 232f671fd0a28d435550afc4e2a9fde63c9e0db2 Mon Sep 17 00:00:00 2001
45 +From: Riley Banks <waultah@×××××.com>
46 +Date: Sun, 11 Oct 2015 10:21:43 +0100
47 +Subject: [PATCH] Implement getargspec using inspect.Signature
48 +
49 +---
50 + bottle.py | 20 +++++++++++++++++++-
51 + 1 file changed, 19 insertions(+), 1 deletion(-)
52 +
53 +diff --git a/bottle.py b/bottle.py
54 +index 9806efd..18ed730 100644
55 +--- a/bottle.py
56 ++++ b/bottle.py
57 +@@ -41,9 +41,27 @@ import base64, cgi, email.utils, functools, hmac, itertools, mimetypes,\
58 + from datetime import date as datedate, datetime, timedelta
59 + from tempfile import TemporaryFile
60 + from traceback import format_exc, print_exc
61 +-from inspect import getargspec
62 + from unicodedata import normalize
63 +
64 ++# inspect.getargspec was removed in Python 3.6, use
65 ++# Signature-based version where we can (Python 3.3+)
66 ++try:
67 ++ from inspect import signature
68 ++ def getargspec(func):
69 ++ params = signature(func).parameters
70 ++ args, varargs, keywords, defaults = [], None, None, []
71 ++ for name, param in params.items():
72 ++ if param.kind == param.VAR_POSITIONAL:
73 ++ varargs = name
74 ++ elif param.kind == param.VAR_KEYWORD:
75 ++ keywords = name
76 ++ else:
77 ++ args.append(name)
78 ++ if param.default is not param.empty:
79 ++ defaults.append(param.default)
80 ++ return (args, varargs, keywords, tuple(defaults) or defaults)
81 ++except ImportError:
82 ++ from inspect import getargspec
83 +
84 + try: from simplejson import dumps as json_dumps, loads as json_lds
85 + except ImportError: # pragma: no cover
86 +--
87 +2.35.1
88 +