Gentoo Archives: gentoo-commits

From: Aaron Bauman <bman@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/notebook/, dev-python/notebook/files/
Date: Sun, 27 May 2018 16:06:39
Message-Id: 1527437160.530b37c13e32df853ea0013c621f9bbeb7efd3f9.bman@gentoo
1 commit: 530b37c13e32df853ea0013c621f9bbeb7efd3f9
2 Author: Marius Brehler <marbre <AT> linux <DOT> sungazer <DOT> de>
3 AuthorDate: Thu Nov 30 15:30:47 2017 +0000
4 Commit: Aaron Bauman <bman <AT> gentoo <DOT> org>
5 CommitDate: Sun May 27 16:06:00 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=530b37c1
7
8 dev-python/notebook: Version bump to 5.2.1
9
10 Package-Manager: Portage-2.3.13, Repoman-2.3.3
11 Closes: https://github.com/gentoo/gentoo/pull/6356
12
13 dev-python/notebook/Manifest | 1 +
14 .../files/notebook-5.2.1-setupbase.py.patch | 44 +++++++++
15 dev-python/notebook/notebook-5.2.1.ebuild | 106 +++++++++++++++++++++
16 3 files changed, 151 insertions(+)
17
18 diff --git a/dev-python/notebook/Manifest b/dev-python/notebook/Manifest
19 index 7301c638257..3444a5d9cbd 100644
20 --- a/dev-python/notebook/Manifest
21 +++ b/dev-python/notebook/Manifest
22 @@ -1 +1,2 @@
23 DIST notebook-5.0.0.tar.gz 11481080 BLAKE2B 3cc483d338ca22c6b4d7199100875e9425f90e1a7059c016cec07500f0558c437db5f7e367a5c4441520deb68fa891be31c07cd93e858c872a1f12d893530479 SHA512 fbee29cc554f36e94b1fe9804187a50581e840cfb5884bcdf2fef82ad9ae3ae0e2082ea0056f815bfa2a1c2f203679169155e61e53253aa2e9004a43ff7fbcae
24 +DIST notebook-5.2.1.tar.gz 12458130 BLAKE2B f10a91fd79064fb09889c4ee30a84a0b34321d3a89f950609df9a90106ed4af75268cc1b087d0229882575d548b7b2b78632aa97452f89fc67910586911fc467 SHA512 defdb08e37dcec9fe799d0b03dc8dc2339f37c9417e4b138ba83b98433dd77f0dea3d83e07368e67f18155af1a67bbabea21ccd061d8a926b6b084fd25960576
25
26 diff --git a/dev-python/notebook/files/notebook-5.2.1-setupbase.py.patch b/dev-python/notebook/files/notebook-5.2.1-setupbase.py.patch
27 new file mode 100644
28 index 00000000000..97be84cb364
29 --- /dev/null
30 +++ b/dev-python/notebook/files/notebook-5.2.1-setupbase.py.patch
31 @@ -0,0 +1,44 @@
32 +Disable bundled mathjax.
33 +
34 +Patch by Marius Brehler.
35 +--- a/setupbase.py
36 ++++ b/setupbase.py
37 +@@ -168,38 +168,6 @@ def find_package_data():
38 + if f.endswith(('.js', '.css')):
39 + static_data.append(pjoin(parent, f))
40 +
41 +- # Trim mathjax
42 +- mj = lambda *path: pjoin(components, 'MathJax', *path)
43 +- static_data.extend([
44 +- mj('MathJax.js'),
45 +- mj('config', 'TeX-AMS-MML_HTMLorMML-full.js'),
46 +- mj('config', 'Safe.js'),
47 +- ])
48 +-
49 +- trees = []
50 +- mj_out = mj('jax', 'output')
51 +-
52 +- if os.path.exists(mj_out):
53 +- for output in os.listdir(mj_out):
54 +- path = pjoin(mj_out, output)
55 +- static_data.append(pjoin(path, '*.js'))
56 +- autoload = pjoin(path, 'autoload')
57 +- if os.path.isdir(autoload):
58 +- trees.append(autoload)
59 +-
60 +- for tree in trees + [
61 +- mj('localization'), # limit to en?
62 +- mj('fonts', 'HTML-CSS', 'STIX-Web', 'woff'),
63 +- mj('extensions'),
64 +- mj('jax', 'input', 'TeX'),
65 +- mj('jax', 'output', 'HTML-CSS', 'fonts', 'STIX-Web'),
66 +- mj('jax', 'output', 'SVG', 'fonts', 'STIX-Web'),
67 +- mj('jax', 'element', 'mml'),
68 +- ]:
69 +- for parent, dirs, files in os.walk(tree):
70 +- for f in files:
71 +- static_data.append(pjoin(parent, f))
72 +-
73 + os.chdir(os.path.join('tests',))
74 + js_tests = glob('*.js') + glob('*/*.js')
75 +
76
77 diff --git a/dev-python/notebook/notebook-5.2.1.ebuild b/dev-python/notebook/notebook-5.2.1.ebuild
78 new file mode 100644
79 index 00000000000..cea2f1f52b8
80 --- /dev/null
81 +++ b/dev-python/notebook/notebook-5.2.1.ebuild
82 @@ -0,0 +1,106 @@
83 +# Copyright 1999-2017 Gentoo Foundation
84 +# Distributed under the terms of the GNU General Public License v2
85 +
86 +EAPI=6
87 +
88 +PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
89 +PYTHON_REQ_USE="threads(+)"
90 +
91 +inherit distutils-r1
92 +
93 +DESCRIPTION="Jupyter Interactive Notebook"
94 +HOMEPAGE="http://jupyter.org"
95 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
96 +
97 +LICENSE="BSD"
98 +SLOT="0"
99 +KEYWORDS="~amd64 ~arm64 ~x86"
100 +IUSE="doc test"
101 +RDEPEND="
102 + >=dev-libs/mathjax-2.4
103 + dev-python/jinja[${PYTHON_USEDEP}]
104 + >=dev-python/terminado-0.3.3[${PYTHON_USEDEP}]
105 + >=www-servers/tornado-4.0[${PYTHON_USEDEP}]
106 + dev-python/ipython_genutils[${PYTHON_USEDEP}]
107 + >=dev-python/traitlets-4.2.1[${PYTHON_USEDEP}]
108 + >=dev-python/jupyter_core-4.4.0[${PYTHON_USEDEP}]
109 + dev-python/jupyter_client[${PYTHON_USEDEP}]
110 + dev-python/nbformat[${PYTHON_USEDEP}]
111 + >=dev-python/nbconvert-4.2.0[${PYTHON_USEDEP}]
112 + dev-python/ipykernel[${PYTHON_USEDEP}]
113 + "
114 +DEPEND="${RDEPEND}
115 + dev-python/setuptools[${PYTHON_USEDEP}]
116 + test? (
117 + $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' 'python2*')
118 + >=dev-python/nose-0.10.1[${PYTHON_USEDEP}]
119 + dev-python/nose_warnings_filters[${PYTHON_USEDEP}]
120 + dev-python/requests[${PYTHON_USEDEP}]
121 + dev-python/coverage[${PYTHON_USEDEP}]
122 + )
123 + doc? (
124 + app-text/pandoc
125 + >=dev-python/ipython-4.0.0[${PYTHON_USEDEP}]
126 + >=dev-python/sphinx-1.3.6[${PYTHON_USEDEP}]
127 + dev-python/sphinx_rtd_theme[${PYTHON_USEDEP}]
128 + =dev-python/nbsphinx-0.2.14[${PYTHON_USEDEP}]
129 + test? (
130 + $(python_gen_cond_dep 'dev-python/nbval[${PYTHON_USEDEP}]' 'python3*')
131 + $(python_gen_cond_dep 'dev-python/pytest[${PYTHON_USEDEP}]' 'python3*')
132 + )
133 + )
134 + "
135 +
136 +PATCHES=( "${FILESDIR}/${P}"-setupbase.py.patch )
137 +
138 +# Opens a qtconsole
139 +restrict="doc"
140 +
141 +python_prepare_all() {
142 + sed \
143 + -e "/import setup/s:$:\nimport setuptools:g" \
144 + -i setup.py || die
145 +
146 + # disable bundled mathjax
147 + sed -i 's/^.*MathJax.*$//' bower.json || die
148 +
149 + # Prevent un-needed download during build
150 + if use doc; then
151 + sed \
152 + -e "/^ 'sphinx.ext.intersphinx',/d" \
153 + -i docs/source/conf.py || die
154 + fi
155 +
156 + distutils-r1_python_prepare_all
157 +}
158 +
159 +python_compile_all() {
160 + if use doc; then
161 + addwrite /dev/dri/card0
162 + emake -C docs html
163 + HTML_DOCS=( docs/build/html/. )
164 + fi
165 +}
166 +
167 +python_test() {
168 + nosetests \
169 + --verbosity=3 \
170 + notebook || die
171 +
172 + if use doc && python_is_python3; then
173 + py.test --nbval --current-env docs || die
174 + fi
175 +}
176 +
177 +python_install() {
178 + distutils-r1_python_install
179 +
180 + ln -sf \
181 + "${EPREFIX}/usr/share/mathjax" \
182 + "${D}$(python_get_sitedir)/notebook/static/components/MathJax" || die
183 +}
184 +
185 +pkg_preinst() {
186 + # remove old mathjax folder if present
187 + rm -rf "${EROOT%/}"/usr/lib*/python*/site-packages/notebook/static/components/MathJax || die
188 +}