summaryrefslogtreecommitdiff
path: root/dev-python/bottle
diff options
context:
space:
mode:
authorLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2022-05-13 14:04:41 +0000
committerLiguros - Gitlab CI/CD [develop] <gitlab@liguros.net>2022-05-13 14:04:41 +0000
commitbdcd1ba0cab23c57f5d926ff7d260f8d83d54ddc (patch)
tree57a259a57c1f6df468700e08b2918f8a380449ad /dev-python/bottle
parent27c4c392e99adae8a219bf11a8f257fa2d4786f5 (diff)
downloadbaldeagleos-repo-bdcd1ba0cab23c57f5d926ff7d260f8d83d54ddc.tar.gz
baldeagleos-repo-bdcd1ba0cab23c57f5d926ff7d260f8d83d54ddc.tar.xz
baldeagleos-repo-bdcd1ba0cab23c57f5d926ff7d260f8d83d54ddc.zip
Adding metadata
Diffstat (limited to 'dev-python/bottle')
-rw-r--r--dev-python/bottle/bottle-0.12.19-r1.ebuild55
-rw-r--r--dev-python/bottle/files/bottle-0.12.19-py311.patch45
2 files changed, 100 insertions, 0 deletions
diff --git a/dev-python/bottle/bottle-0.12.19-r1.ebuild b/dev-python/bottle/bottle-0.12.19-r1.ebuild
new file mode 100644
index 000000000000..9f5746ba7655
--- /dev/null
+++ b/dev-python/bottle/bottle-0.12.19-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{7,8,9,10} pypy3 )
+
+inherit distutils-r1 optfeature
+
+DESCRIPTION="A fast and simple micro-framework for small web-applications"
+HOMEPAGE="
+ https://bottlepy.org/
+ https://github.com/bottlepy/bottle/
+ https://pypi.org/project/bottle/
+"
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ test? (
+ dev-python/mako[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.12.8-py3.5-backport.patch
+ "${FILESDIR}"/${P}-py311.patch
+)
+
+python_prepare_all() {
+ sed -i -e '/scripts/d' setup.py || die
+
+ # Remove test file requring connection to network
+ rm test/test_server.py || die
+ distutils-r1_python_prepare_all
+}
+
+python_test() {
+ "${EPYTHON}" test/testall.py || die "tests failed under ${EPYTHON}"
+}
+
+pkg_postinst() {
+ optfeature "Templating support" dev-python/mako
+ elog "Due to problems with bottle.py being in /usr/bin (see bug #474874)"
+ elog "we do as most other distros and do not install the script anymore."
+ elog "If you do want/have to call it directly rather than through your app,"
+ elog "please use the following instead:"
+ elog ' `python -m bottle`'
+}
diff --git a/dev-python/bottle/files/bottle-0.12.19-py311.patch b/dev-python/bottle/files/bottle-0.12.19-py311.patch
new file mode 100644
index 000000000000..c7c36c3a37ee
--- /dev/null
+++ b/dev-python/bottle/files/bottle-0.12.19-py311.patch
@@ -0,0 +1,45 @@
+From 232f671fd0a28d435550afc4e2a9fde63c9e0db2 Mon Sep 17 00:00:00 2001
+From: Riley Banks <waultah@gmail.com>
+Date: Sun, 11 Oct 2015 10:21:43 +0100
+Subject: [PATCH] Implement getargspec using inspect.Signature
+
+---
+ bottle.py | 20 +++++++++++++++++++-
+ 1 file changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/bottle.py b/bottle.py
+index 9806efd..18ed730 100644
+--- a/bottle.py
++++ b/bottle.py
+@@ -41,9 +41,27 @@ import base64, cgi, email.utils, functools, hmac, itertools, mimetypes,\
+ from datetime import date as datedate, datetime, timedelta
+ from tempfile import TemporaryFile
+ from traceback import format_exc, print_exc
+-from inspect import getargspec
+ from unicodedata import normalize
+
++# inspect.getargspec was removed in Python 3.6, use
++# Signature-based version where we can (Python 3.3+)
++try:
++ from inspect import signature
++ def getargspec(func):
++ params = signature(func).parameters
++ args, varargs, keywords, defaults = [], None, None, []
++ for name, param in params.items():
++ if param.kind == param.VAR_POSITIONAL:
++ varargs = name
++ elif param.kind == param.VAR_KEYWORD:
++ keywords = name
++ else:
++ args.append(name)
++ if param.default is not param.empty:
++ defaults.append(param.default)
++ return (args, varargs, keywords, tuple(defaults) or defaults)
++except ImportError:
++ from inspect import getargspec
+
+ try: from simplejson import dumps as json_dumps, loads as json_lds
+ except ImportError: # pragma: no cover
+--
+2.35.1
+