From 1c9cbd09962b99b6cf252fb7a8e988ddb5d00061 Mon Sep 17 00:00:00 2001 From: Alexey Shvetsov Date: Tue, 23 Apr 2019 18:06:26 +0300 Subject: dev-python/flask: Ressurect old ebuild Package-Manager: Portage-2.3.64, Repoman-2.3.12 Signed-off-by: Alexey Shvetsov --- dev-python/flask/Manifest | 1 + .../flask/files/flask-0.10.1-is_package.patch | 13 +++++ .../flask/files/flask-0.10.1-sort_json.patch | 54 +++++++++++++++++++ .../flask/files/flask-0.10.1-test_appcontext.patch | 14 +++++ dev-python/flask/flask-0.10.1-r2.ebuild | 60 ++++++++++++++++++++++ dev-python/flask/metadata.xml | 12 +++++ 6 files changed, 154 insertions(+) create mode 100644 dev-python/flask/Manifest create mode 100644 dev-python/flask/files/flask-0.10.1-is_package.patch create mode 100644 dev-python/flask/files/flask-0.10.1-sort_json.patch create mode 100644 dev-python/flask/files/flask-0.10.1-test_appcontext.patch create mode 100644 dev-python/flask/flask-0.10.1-r2.ebuild create mode 100644 dev-python/flask/metadata.xml diff --git a/dev-python/flask/Manifest b/dev-python/flask/Manifest new file mode 100644 index 0000000..f28be97 --- /dev/null +++ b/dev-python/flask/Manifest @@ -0,0 +1 @@ +DIST Flask-0.10.1.tar.gz 544247 SHA256 4c83829ff83d408b5e1d4995472265411d2c414112298f2eb4b359d9e4563373 SHA512 0008d62d03a46b071c7d0510513d011a9bfd2b77df7f677371a446ca9805d16b1ee5e17dd8dd7cde6443a629370234e44735e20381de20a7da385969797f053f WHIRLPOOL f30a306ed00fe6d4c8e47b781c556c576b99b3545f833ae06f6b778d91c3127dc0adcc34d48221a0f1db1bb1633f2329d6085b7a4550afc672530525fdff474f diff --git a/dev-python/flask/files/flask-0.10.1-is_package.patch b/dev-python/flask/files/flask-0.10.1-is_package.patch new file mode 100644 index 0000000..611d931 --- /dev/null +++ b/dev-python/flask/files/flask-0.10.1-is_package.patch @@ -0,0 +1,13 @@ +https://github.com/mitsuhiko/flask/issues/487 +diff -ur Flask-0.10.1.orig/flask/helpers.py Flask-0.10.1/flask/helpers.py +--- flask/helpers.py 2013-06-14 06:35:43.000000000 +0800 ++++ flask/helpers.py 2013-08-16 16:18:36.194006290 +0800 +@@ -679,7 +679,7 @@ + filename = sys.modules[import_name].__file__ + package_path = os.path.abspath(os.path.dirname(filename)) + # package_path ends with __init__.py for a package +- if loader.is_package(root_mod_name): ++ if package_path.endswith('__init__.py'): + package_path = os.path.dirname(package_path) + + site_parent, site_folder = os.path.split(package_path) diff --git a/dev-python/flask/files/flask-0.10.1-sort_json.patch b/dev-python/flask/files/flask-0.10.1-sort_json.patch new file mode 100644 index 0000000..e78cd0d --- /dev/null +++ b/dev-python/flask/files/flask-0.10.1-sort_json.patch @@ -0,0 +1,54 @@ +https://github.com/mitsuhiko/flask/commit/a2bc61b5ab19e899735f8945f68123b4cea570d5 +diff --git a/flask/testsuite/helpers.py b/flask/testsuite/helpers.py +index 636f67f..7de70c0 100644 +--- a/flask/testsuite/helpers.py ++++ b/flask/testsuite/helpers.py +@@ -173,7 +173,33 @@ def index(): + c = app.test_client() + rv = c.get('/') + lines = [x.strip() for x in rv.data.strip().decode('utf-8').splitlines()] +- self.assert_equal(lines, [ ++ sorted_by_str = [ ++ '{', ++ '"values": {', ++ '"0": "foo",', ++ '"1": "foo",', ++ '"10": "foo",', ++ '"11": "foo",', ++ '"12": "foo",', ++ '"13": "foo",', ++ '"14": "foo",', ++ '"15": "foo",', ++ '"16": "foo",', ++ '"17": "foo",', ++ '"18": "foo",', ++ '"19": "foo",', ++ '"2": "foo",', ++ '"3": "foo",', ++ '"4": "foo",', ++ '"5": "foo",', ++ '"6": "foo",', ++ '"7": "foo",', ++ '"8": "foo",', ++ '"9": "foo"', ++ '}', ++ '}' ++ ] ++ sorted_by_int = [ + '{', + '"values": {', + '"0": "foo",', +@@ -198,8 +224,12 @@ def index(): + '"19": "foo"', + '}', + '}' +- ]) ++ ] + ++ try: ++ self.assert_equal(lines, sorted_by_int) ++ except AssertionError: ++ self.assert_equal(lines, sorted_by_str) + + class SendfileTestCase(FlaskTestCase): + diff --git a/dev-python/flask/files/flask-0.10.1-test_appcontext.patch b/dev-python/flask/files/flask-0.10.1-test_appcontext.patch new file mode 100644 index 0000000..11dee7a --- /dev/null +++ b/dev-python/flask/files/flask-0.10.1-test_appcontext.patch @@ -0,0 +1,14 @@ +https://github.com/mitsuhiko/flask/commit/f88cc2d2f9d14d97e33ddd2bbaa4b1885db06e1c. +diff --git a/flask/testsuite/signals.py b/flask/testsuite/signals.py +index e061932..45ca45d 100644 +--- a/flask/testsuite/signals.py ++++ b/flask/testsuite/signals.py +@@ -102,7 +102,7 @@ def test_appcontext_signals(self): + def record_push(sender, **kwargs): + recorded.append('push') + def record_pop(sender, **kwargs): +- recorded.append('push') ++ recorded.append('pop') + + @app.route('/') + def index(): diff --git a/dev-python/flask/flask-0.10.1-r2.ebuild b/dev-python/flask/flask-0.10.1-r2.ebuild new file mode 100644 index 0000000..f2d94b8 --- /dev/null +++ b/dev-python/flask/flask-0.10.1-r2.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2019 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI="7" + +PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy ) + +inherit distutils-r1 + +DESCRIPTION="A microframework based on Werkzeug, Jinja2 and good intentions" +MY_PN="Flask" +MY_P="${MY_PN}-${PV}" +SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz" +HOMEPAGE="https://github.com/mitsuhiko/flask/" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64" +IUSE="doc examples" + +RDEPEND=" + dev-python/blinker[${PYTHON_USEDEP}] + >=dev-python/itsdangerous-0.21[${PYTHON_USEDEP}] + >=dev-python/jinja-2.4[${PYTHON_USEDEP}] + dev-python/setuptools[${PYTHON_USEDEP}] + >=dev-python/werkzeug-0.7[${PYTHON_USEDEP}] + doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )" +BDEPEND="${RDEPEND}" +# Usual; test phase +DISTUTILS_IN_SOURCE_BUILD=1 + +S="${WORKDIR}/${MY_P}" + +PATCHES=( + "${FILESDIR}"/${P}-is_package.patch + "${FILESDIR}"/${P}-sort_json.patch + "${FILESDIR}"/${P}-test_appcontext.patch +) + +python_prepare_all() { + # Prevent un-needed d'loading + sed -e "s/ 'sphinx.ext.intersphinx',//" -i docs/conf.py || die + + distutils-r1_python_prepare_all +} + +python_compile_all() { + use doc && emake -C docs html +} + +python_test() { + "${PYTHON}" run-tests.py || die "Testing failed with ${EPYTHON}" +} + +python_install_all() { + use examples && local EXAMPLES=( examples/. ) + use doc && HTML_DOCS=( docs/_build/html/. ) + + distutils-r1_python_install_all +} diff --git a/dev-python/flask/metadata.xml b/dev-python/flask/metadata.xml new file mode 100644 index 0000000..0d86093 --- /dev/null +++ b/dev-python/flask/metadata.xml @@ -0,0 +1,12 @@ + + + + + python@gentoo.org + Python + + + Flask + mitsuhiko/flask + + -- cgit v1.2.3-65-gdbad