dev-python/ipython: Drop old

Closes: https://bugs.gentoo.org/596714
Package-Manager: Portage-2.3.36, Repoman-2.3.9
This commit is contained in:
Andreas Sturmlechner
2018-05-10 19:19:08 +02:00
parent 7487ea6a6a
commit ab0a94d6c8
7 changed files with 0 additions and 351 deletions

View File

@@ -1,3 +1,2 @@
DIST ipython-3.2.1.tar.gz 10884249 BLAKE2B eaeb5ad3cb1cfd38c5f81e0d312773e0ba617fc2ef735f5705edafd2e9bc65169302ea8f775843c7da5029bce0dccb541233a7c82faf58a676ac5079f9664734 SHA512 de7723e3b859d21a58a24456c76c8d8ec98c019f290f61269f46270e7647d2b49a98671138fecd75cb6f46384fde7e09618eb5c85c175e0e442c7fae7328d8fe
DIST ipython-5.4.1.tar.gz 4973571 BLAKE2B bbda7b5a172ea1e80a9867f036ef68d1d0ec0a7340d77d8b4bbce63c5db7d3aade106ee5a6d59fb7e2b773c37d8263e51e1eaaa81d582849a70de60e93b7205a SHA512 b37dae27a558585ec4f42fa22e86380ac81990207ec680fc7b0e6f97ac81c99d915cfe77488bc0b91a61c34e0c00b323df08aa06b142ce0fc88ce30203102907
DIST ipython-6.1.0.tar.gz 5066094 BLAKE2B 4f68776ba15f50b2f0fcc1503dd5c62ac464d9d0ace0801f572c9cdc1a0ddd7d840369a3df5940551c848376985cc74848002cef53869014adb2fd9714989acd SHA512 6b1d9713b5e8c3870ac8cd8bea9d3a6f0c0302e3983017516128ede9f0baba21372890873df29fbba3f9d2f47ba16bfadb1c611f9de23b71595c0ab8f917695b

View File

@@ -1,55 +0,0 @@
Upstream patch to fix
"Maliciously crafted text files in IPython/Jupyter editor".
http://seclists.org/oss-sec/2015/q3/558
https://bugs.gentoo.org/show_bug.cgi?id=560708
From 2b835ca6daec2592d9127dc85bf2cdcfb718edf2 Mon Sep 17 00:00:00 2001
From: Min RK <benjaminrk@gmail.com>
Date: Mon, 20 Jul 2015 12:11:23 -0700
Subject: [PATCH 4/4] Don't redirect from /edit/ to /files/
show failure to decode, instead
---
IPython/html/static/edit/js/editor.js | 15 +++------------
1 file changed, 3 insertions(+), 12 deletions(-)
diff --git a/IPython/html/static/edit/js/editor.js b/IPython/html/static/edit/js/editor.js
index dd12ea4..75d65e0 100644
--- a/IPython/html/static/edit/js/editor.js
+++ b/IPython/html/static/edit/js/editor.js
@@ -90,19 +90,10 @@ function($,
}).catch(
function(error) {
that.events.trigger("file_load_failed.Editor", error);
- if (((error.xhr||{}).responseJSON||{}).reason === 'bad format') {
- window.location = utils.url_path_join(
- that.base_url,
- 'files',
- that.file_path
- );
- } else {
- console.warn('Error while loading: the error was:')
- console.warn(error)
- }
+ console.warn('Error loading: ', error);
cm.setValue("Error! " + error.message +
"\nSaving disabled.\nSee Console for more details.");
- cm.setOption('readOnly','nocursor')
+ cm.setOption('readOnly','nocursor');
that.save_enabled = false;
}
);
@@ -186,7 +177,7 @@ function($,
Editor.prototype._clean_state = function(){
var clean = this.codemirror.isClean(this.generation);
if (clean === this.clean){
- return
+ return;
} else {
this.clean = clean;
}
--
2.4.6

View File

@@ -1,38 +0,0 @@
Upstream patch to fix
"Maliciously crafted text files in IPython/Jupyter editor".
http://seclists.org/oss-sec/2015/q3/558
https://bugs.gentoo.org/show_bug.cgi?id=560708
From df24d9153b86863ccfa98bf509704d9304143ce1 Mon Sep 17 00:00:00 2001
From: Min RK <benjaminrk@gmail.com>
Date: Mon, 20 Jul 2015 12:11:04 -0700
Subject: [PATCH 3/4] only redirect to editor for text documents
treat unidentified mime-types as text
---
IPython/html/static/tree/js/notebooklist.js | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/IPython/html/static/tree/js/notebooklist.js b/IPython/html/static/tree/js/notebooklist.js
index 0065143..d8c7b2a 100644
--- a/IPython/html/static/tree/js/notebooklist.js
+++ b/IPython/html/static/tree/js/notebooklist.js
@@ -532,6 +532,13 @@ define([
icon = 'running_' + icon;
}
var uri_prefix = NotebookList.uri_prefixes[model.type];
+ if (model.type === 'file' &&
+ model.mimetype && model.mimetype.substr(0,5) !== 'text/'
+ ) {
+ // send text/unidentified files to editor, others go to raw viewer
+ uri_prefix = 'files';
+ }
+
item.find(".item_icon").addClass(icon).addClass('icon-fixed-width');
var link = item.find("a.item_link")
.attr('href',
--
2.4.6

View File

@@ -1,35 +0,0 @@
Upstream patch to fix
"Maliciously crafted text files in IPython/Jupyter editor".
http://seclists.org/oss-sec/2015/q3/558
https://bugs.gentoo.org/show_bug.cgi?id=560708
From d729ce7c2063c0de746a7c2ea39697040d0af5bf Mon Sep 17 00:00:00 2001
From: Min RK <benjaminrk@gmail.com>
Date: Mon, 20 Jul 2015 12:10:10 -0700
Subject: [PATCH 1/4] set mime-type on /files/
---
IPython/html/files/handlers.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/IPython/html/files/handlers.py b/IPython/html/files/handlers.py
index 7727d08..b358d94 100644
--- a/IPython/html/files/handlers.py
+++ b/IPython/html/files/handlers.py
@@ -40,6 +40,11 @@ def get(self, path):
cur_mime = mimetypes.guess_type(name)[0]
if cur_mime is not None:
self.set_header('Content-Type', cur_mime)
+ else:
+ if model['format'] == 'base64':
+ self.set_header('Content-Type', 'application/octet-stream')
+ else:
+ self.set_header('Content-Type', 'text/plain')
if model['format'] == 'base64':
b64_bytes = model['content'].encode('ascii')
--
2.4.6

View File

@@ -1,64 +0,0 @@
Upstream patch to fix
"Maliciously crafted text files in IPython/Jupyter editor".
http://seclists.org/oss-sec/2015/q3/558
https://bugs.gentoo.org/show_bug.cgi?id=560708
From 50a1366a8fcfb94671c87199515ebc922882f447 Mon Sep 17 00:00:00 2001
From: Min RK <benjaminrk@gmail.com>
Date: Mon, 20 Jul 2015 12:10:25 -0700
Subject: [PATCH 2/4] set model mimetype, even when content=False
---
IPython/html/services/contents/filemanager.py | 12 +++++++-----
IPython/html/services/contents/handlers.py | 3 ---
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/IPython/html/services/contents/filemanager.py b/IPython/html/services/contents/filemanager.py
index 01ce07b..c869c75 100644
--- a/IPython/html/services/contents/filemanager.py
+++ b/IPython/html/services/contents/filemanager.py
@@ -277,18 +277,20 @@ def _file_model(self, path, content=True, format=None):
model['type'] = 'file'
os_path = self._get_os_path(path)
+ model['mimetype'] = mimetypes.guess_type(os_path)[0]
if content:
content, format = self._read_file(os_path, format)
- default_mime = {
- 'text': 'text/plain',
- 'base64': 'application/octet-stream'
- }[format]
+ if model['mimetype'] is None:
+ default_mime = {
+ 'text': 'text/plain',
+ 'base64': 'application/octet-stream'
+ }[format]
+ model['mimetype'] = default_mime
model.update(
content=content,
format=format,
- mimetype=mimetypes.guess_type(os_path)[0] or default_mime,
)
return model
diff --git a/IPython/html/services/contents/handlers.py b/IPython/html/services/contents/handlers.py
index 5cd849e..d77e70e 100644
--- a/IPython/html/services/contents/handlers.py
+++ b/IPython/html/services/contents/handlers.py
@@ -52,9 +52,6 @@ def validate_model(model, expect_content):
)
maybe_none_keys = ['content', 'format']
- if model['type'] == 'file':
- # mimetype should be populated only for file models
- maybe_none_keys.append('mimetype')
if expect_content:
errors = [key for key in maybe_none_keys if model[key] is None]
if errors:
--
2.4.6

View File

@@ -1,156 +0,0 @@
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI=5
PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
PYTHON_REQ_USE='readline,sqlite,threads(+)'
inherit distutils-r1 eutils virtualx
DESCRIPTION="Advanced interactive shell for Python"
HOMEPAGE="http://ipython.org/"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 ~arm ~mips ~ppc ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
IUSE="doc examples matplotlib mongodb notebook nbconvert octave qt4 +smp test wxwidgets"
REQUIRED_USE="
test? ( doc matplotlib mongodb notebook nbconvert octave qt4 wxwidgets )
doc? ( mongodb )"
CDEPEND="
dev-python/decorator[${PYTHON_USEDEP}]
dev-python/pexpect[${PYTHON_USEDEP}]
dev-python/pyparsing[${PYTHON_USEDEP}]
dev-python/simplegeneric[${PYTHON_USEDEP}]
matplotlib? ( dev-python/matplotlib[${PYTHON_USEDEP}] )
mongodb? ( <dev-python/pymongo-3[${PYTHON_USEDEP}] )
octave? ( dev-python/oct2py[${PYTHON_USEDEP}] )
smp? ( >=dev-python/pyzmq-13[${PYTHON_USEDEP}] )
wxwidgets? ( $(python_gen_cond_dep 'dev-python/wxpython:*[${PYTHON_USEDEP}]' python2_7) )"
RDEPEND="${CDEPEND}
notebook? (
dev-libs/mathjax
dev-python/jinja[${PYTHON_USEDEP}]
>=dev-python/jsonschema-2.0[${PYTHON_USEDEP}]
>=dev-python/mistune-0.5[${PYTHON_USEDEP}]
dev-python/pygments[${PYTHON_USEDEP}]
>=dev-python/pyzmq-13[${PYTHON_USEDEP}]
>=dev-python/terminado-0.3.3[${PYTHON_USEDEP}]
>=www-servers/tornado-4.0[${PYTHON_USEDEP}]
)
nbconvert? (
|| ( >=net-libs/nodejs-0.9.12 >=app-text/pandoc-1.12.1 )
dev-python/jinja[${PYTHON_USEDEP}]
>=dev-python/jsonschema-2.0[${PYTHON_USEDEP}]
>=dev-python/mistune-0.5[${PYTHON_USEDEP}]
dev-python/pygments[${PYTHON_USEDEP}]
dev-python/sphinx[${PYTHON_USEDEP}]
)
qt4? (
|| (
dev-python/PyQt4[${PYTHON_USEDEP},svg]
dev-python/PyQt5[${PYTHON_USEDEP},svg]
dev-python/pyside[${PYTHON_USEDEP},svg]
)
dev-python/pygments[${PYTHON_USEDEP}]
>=dev-python/pyzmq-13[${PYTHON_USEDEP}] )"
DEPEND="${CDEPEND}
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
app-text/dvipng
dev-python/jinja[${PYTHON_USEDEP}]
$(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7)
>=dev-python/nose-0.10.1[${PYTHON_USEDEP}]
dev-python/requests[${PYTHON_USEDEP}]
dev-python/sphinx[${PYTHON_USEDEP}]
>=www-servers/tornado-4.0[${PYTHON_USEDEP}]
)
doc? (
dev-python/cython[${PYTHON_USEDEP}]
$(python_gen_cond_dep 'dev-python/fabric[${PYTHON_USEDEP}]' python2_7)
>=dev-python/jsonschema-2.0[${PYTHON_USEDEP}]
dev-python/matplotlib[${PYTHON_USEDEP}]
>=dev-python/nose-0.10.1[${PYTHON_USEDEP}]
dev-python/numpydoc[${PYTHON_USEDEP}]
dev-python/rpy[${PYTHON_USEDEP}]
>=dev-python/sphinx-1.1[${PYTHON_USEDEP}]
>=www-servers/tornado-4.0[${PYTHON_USEDEP}]
)"
PATCHES=(
"${FILESDIR}"/2.1.0-substitute-files.patch
"${FILESDIR}/${P}"-set-mime-type-on-files.patch
"${FILESDIR}/${P}"-set-model-mimetype-even-when-content-False.patch
"${FILESDIR}/${P}"-only-redirect-to-editor-for-text-documents.patch
"${FILESDIR}/${P}"-Don-t-redirect-from-edit-to-files.patch
)
DISTUTILS_IN_SOURCE_BUILD=1
python_prepare_all() {
# Remove out of date insource files
rm IPython/extensions/rmagic.py || die
# Prevent un-needed download during build
if use doc; then
sed -e "/^ 'sphinx.ext.intersphinx',/d" -i docs/source/conf.py || die
fi
distutils-r1_python_prepare_all
}
python_compile_all() {
use doc && emake -C docs html_noapi
}
python_test() {
distutils_install_for_testing
# https://github.com/ipython/ipython/issues/8639
# Failure of some modules only in python3.4
local fail
run_tests() {
pushd ${TEST_DIR} > /dev/null || die
"${PYTHON}" -m IPython.testing.iptestcontroller --all || fail=1
popd > /dev/null || die
}
VIRTUALX_COMMAND=run_tests virtualmake
[[ ${fail} ]] && die "Tests fail with ${EPYTHON}"
}
python_install() {
distutils-r1_python_install
use notebook && \
ln -sf "${EPREFIX}/usr/share/mathjax" "${D}$(python_get_sitedir)/IPython/html/static/mathjax"
# Create ipythonX.Y symlinks.
# TODO:
# 1. do we want them for pypy? No. pypy has no numpy
# 2. handle it in the eclass instead (use _python_ln_rel).
# With pypy not an option the dosym becomes unconditional
dosym ../lib/python-exec/${EPYTHON}/ipython \
/usr/bin/ipython${EPYTHON#python}
}
python_install_all() {
use doc && local HTML_DOCS=( docs/build/html/. )
use examples && local EXAMPLES=( examples/. )
distutils-r1_python_install_all
}
pkg_postinst() {
optfeature "sympyprinting" dev-python/sympy
optfeature "cythonmagic" dev-python/cython
optfeature "%lprun magic command" dev-python/line_profiler
optfeature "%mprun magic command" dev-python/memory_profiler
if use nbconvert; then
if ! has_version app-text/pandoc ; then
einfo "Node.js will be used to convert notebooks to other formats"
einfo "like HTML. Support for that is still experimental. If you"
einfo "encounter any problems, please use app-text/pandoc instead."
fi
fi
}

View File

@@ -43,10 +43,8 @@
</longdescription>
<use>
<flag name="matplotlib">Add support for <pkg>dev-python/matplotlib</pkg></flag>
<flag name="mongodb">Enable support for MongoDB via <pkg>dev-python/pymongo</pkg></flag>
<flag name="notebook">Install requirements for the web notebook based on <pkg>www-servers/tornado</pkg></flag>
<flag name="nbconvert">Enable support for converting notebooks to various formats using <pkg>app-text/pandoc</pkg></flag>
<flag name="octave">Enable octave bridge via <pkg>dev-python/oct2py</pkg></flag>
</use>
<upstream>
<remote-id type="pypi">ipython</remote-id>