New package: python-ipython-2.4.1

This commit is contained in:
Alessio Sergi 2015-02-19 13:31:00 +01:00
parent 8e0e30c91d
commit a23cc82c6c
10 changed files with 205 additions and 0 deletions

View file

@ -0,0 +1 @@
python-ipython

View file

@ -0,0 +1 @@
python-ipython

View file

@ -0,0 +1,8 @@
This package contains the basic ipython terminal shell.
For the Qt console install python-ipython-qtconsole.
For the HTML notebook install python-ipython-notebook.
For the matplotlib integration install python-matplotlib.
To convert notebooks between various formats install the following
dependencies: python-Jinja2, python-Pygments, python-Sphinx, pandoc.

View file

@ -0,0 +1,32 @@
Description: don't fail startup if ipython-notebook is not installed
e.g. ipython locate triggers this code but doesn't need the notebook css files
--- IPython/core/profiledir.py
+++ IPython/core/profiledir.py
@@ -173,15 +173,18 @@ class ProfileDir(LoggingConfigurable):
self._mkdir(self.static_dir)
custom = os.path.join(self.static_dir, 'custom')
self._mkdir(custom)
- from IPython.html import DEFAULT_STATIC_FILES_PATH
- for fname in ('custom.js', 'custom.css'):
- src = os.path.join(DEFAULT_STATIC_FILES_PATH, 'custom', fname)
- dest = os.path.join(custom, fname)
- if not os.path.exists(src):
- self.log.warn("Could not copy default file to static dir. Source file %s does not exist.", src)
- continue
- if not os.path.exists(dest):
- shutil.copy(src, dest)
+ try:
+ from IPython.html import DEFAULT_STATIC_FILES_PATH
+ for fname in ('custom.js', 'custom.css'):
+ src = os.path.join(DEFAULT_STATIC_FILES_PATH, 'custom', fname)
+ dest = os.path.join(custom, fname)
+ if not os.path.exists(src):
+ self.log.warn("Could not copy default file to static dir. Source file %s does not exist.", src)
+ continue
+ if not os.path.exists(dest):
+ shutil.copy(src, dest)
+ except ImportError:
+ pass # ipython-notebook not installed
def check_dirs(self):
self.check_security_dir()

View file

@ -0,0 +1,25 @@
--- IPython/html/notebookapp.py
+++ IPython/html/notebookapp.py
@@ -218,6 +218,11 @@ class NotebookWebApplication(web.Applica
pattern = url_path_join(settings['base_url'], handler[0])
new_handler = tuple([pattern] + list(handler[1:]))
new_handlers.append(new_handler)
+
+ if os.path.exists("/usr/share/mathjax/MathJax.js"):
+ new_handlers.append((r"/mathjax/(.*)", web.StaticFileHandler,
+ {"path": "/usr/share/mathjax"}))
+
# add 404 on the end, which will catch everything that falls through
new_handlers.append((r'(.*)', Template404))
return new_handlers
@@ -514,6 +519,10 @@ class NotebookApp(BaseIPythonApplication
url = url_path_join(url_prefix, u"mathjax/MathJax.js")
self.log.info("Serving local MathJax from %s at %s", mathjax, url)
return url
+
+ if os.path.exists("/usr/share/mathjax/MathJax.js"):
+ self.log.info("Using system MathJax")
+ return u"/mathjax/MathJax.js"
# no local mathjax, serve from CDN
url = u"https://cdn.mathjax.org/mathjax/latest/MathJax.js"

View file

@ -0,0 +1,9 @@
This package contains the Python 3 variant of ipython terminal shell.
For the Qt console install python3.4-ipython-qtconsole.
For the HTML notebook install python3.4-ipython-notebook.
For the matplotlib integration install python3.4-matplotlib.
To convert notebooks between various formats install the following
dependencies: python3.4-Jinja2, python3.4-Pygments, python3.4-Sphinx,
pandoc.

View file

@ -0,0 +1,126 @@
# Template file for 'python-ipython'
pkgname=python-ipython
version=2.4.1
revision=1
noarch=yes
wrksrc="ipython-${version}"
build_style=python-module
python_versions="2.7 3.4"
hostmakedepends="
python-setuptools python3.4-setuptools python-Sphinx python3.4-Sphinx
python-Pygments python3.4-Pygments python-tornado python3.4-tornado
python-Jinja2 python3.4-Jinja2 python-pyzmq python3.4-pyzmq python-pexpect
python3.4-pexpect"
makedepends="${hostmakedepends}"
depends="python-decorator python-jsonpointer python-jsonschema python-path
python-pexpect python-simplegeneric"
pycompile_module="IPython"
short_desc="Enhanced interactive Python2 shell"
_short_desc="${short_desc/Python2/Python3.4}"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://ipython.org/"
license="3-clause-BSD"
distfiles="${PYPI_SITE}/i/ipython/ipython-${version}.tar.gz"
checksum=6d350b5c2d3e925b0ff6167658812d720b891e476238d924504e2f7f483e9217
# explicit order, do not change
subpackages="python-ipython-notebook python3.4-ipython-notebook python3.4-ipython"
if [ -z "$CROSS_BUILD" ]; then
subpackages+=" python-ipython-qtconsole python3.4-ipython-qtconsole"
fi
pre_build() {
# remove shebangs
find IPython -type f -name '*.py' -exec sed -i '/^#!.*python$/d' {} +
# rename man pages
for f in docs/man/*; do
cp ${f} ${f/%.1/3.1}
done
}
post_install() {
# remove bundled libraries
for f in decorator{,s} json{pointer,schema} path pexpect simplegeneric; do
find ${DESTDIR} -type f -name _${f}.py -delete
done
# remove qtconsole
rm -rf ${DESTDIR}/usr/lib/python*/site-packages/IPython/qt
# drop '2' suffix from bin names
for f in ${DESTDIR}/usr/bin/*2; do
mv ${f} ${f/%2/}
done
# install qtconsole.desktop files
if [ -z "$CROSS_BUILD" ]; then
install -Dm644 "${wrksrc}/examples/IPython Kernel/ipython-qtconsole.desktop" \
${DESTDIR}/usr/share/applications/ipython-qtconsole.desktop
sed -i 's/ipython/&3/g;s/IPython/&3/g' "${wrksrc}/examples/IPython Kernel/ipython-qtconsole.desktop"
install -Dm644 "${wrksrc}/examples/IPython Kernel/ipython-qtconsole.desktop" \
${DESTDIR}/usr/share/applications/ipython3-qtconsole.desktop
fi
# install license
vlicense COPYING.rst LICENSE
}
python-ipython-notebook_package() {
noarch=yes
depends="${sourcepkg}>=${version}_${revision} python-pyzmq python-Jinja2
python-tornado mathjax"
short_desc+=" - HTML notebook"
pycompile_module="IPython"
pkg_install() {
vmove usr/lib/python2.7/site-packages/IPython/html
}
}
python-ipython-qtconsole_package() {
noarch=yes
depends="${sourcepkg}>=${version}_${revision} python-pyzmq python-Pygments
python-PyQt4 desktop-file-utils"
short_desc+=" - Qt console"
pycompile_module="IPython"
pkg_install() {
vmkdir usr/lib/python2.7/site-packages/IPython
vcopy ${wrksrc}/IPython/qt usr/lib/python2.7/site-packages/IPython
vmove usr/share/applications/ipython-qtconsole.desktop
}
}
python3.4-ipython_package() {
noarch=yes
depends="python3.4-decorator python3.4-jsonpointer python3.4-jsonschema
python3.4-path python3.4-pexpect python3.4-simplegeneric"
short_desc="${_short_desc}"
pycompile_version="3.4"
pycompile_module="IPython"
pkg_install() {
vmove usr/bin/*3
vmove usr/lib/python3.4
vmove usr/share/man/man1/*3.1
vlicense ${wrksrc}/COPYING.rst LICENSE
}
}
python3.4-ipython-notebook_package() {
noarch=yes
depends="python3.4-ipython>=${version}_${revision} python3.4-pyzmq
python3.4-Jinja2 python3.4-tornado mathjax"
short_desc="${_short_desc} - HTML notebook"
pycompile_module="IPython"
pkg_install() {
vmove usr/lib/python3.4/site-packages/IPython/html
}
}
python3.4-ipython-qtconsole_package() {
noarch=yes
depends="python3.4-ipython>=${version}_${revision} python3.4-pyzmq
python3.4-Pygments python3.4-PyQt4 desktop-file-utils"
short_desc="${_short_desc} - Qt console"
pycompile_version="3.4"
pycompile_module="IPython"
pkg_install() {
vmkdir usr/lib/python3.4/site-packages/IPython
vcopy ${wrksrc}/IPython/qt usr/lib/python3.4/site-packages/IPython
vmove usr/share/applications/ipython3-qtconsole.desktop
}
}

1
srcpkgs/python3.4-ipython Symbolic link
View file

@ -0,0 +1 @@
python-ipython

View file

@ -0,0 +1 @@
python-ipython

View file

@ -0,0 +1 @@
python-ipython