summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-06-09 20:05:31 +0200
committerMichał Górny <mgorny@gentoo.org>2020-06-10 09:31:48 +0200
commit0777bf441d0481947d4a9ab04462ffe113a4e3e9 (patch)
tree4d5a2dc683c14e698a29360d7cc487884df1e05f /dev-python/notebook
parentdev-python/nbconvert: Port to py3.9 (diff)
downloadgentoo-0777bf441d0481947d4a9ab04462ffe113a4e3e9.tar.gz
gentoo-0777bf441d0481947d4a9ab04462ffe113a4e3e9.tar.bz2
gentoo-0777bf441d0481947d4a9ab04462ffe113a4e3e9.zip
dev-python/notebook: Port to py3.9
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/notebook')
-rw-r--r--dev-python/notebook/files/notebook-6.0.3-py39.patch73
-rw-r--r--dev-python/notebook/notebook-6.0.3.ebuild7
2 files changed, 78 insertions, 2 deletions
diff --git a/dev-python/notebook/files/notebook-6.0.3-py39.patch b/dev-python/notebook/files/notebook-6.0.3-py39.patch
new file mode 100644
index 000000000000..2b0fc134b58a
--- /dev/null
+++ b/dev-python/notebook/files/notebook-6.0.3-py39.patch
@@ -0,0 +1,73 @@
+From c01b2cc014af5c3f8c1e00907a985edc19cad8d7 Mon Sep 17 00:00:00 2001
+From: Karthikeyan Singaravelan <tir.karthi@gmail.com>
+Date: Wed, 22 Jan 2020 00:41:58 +0530
+Subject: [PATCH] Remove deprecated encoding parameter for Python 3.9
+ compatibility.
+
+---
+ notebook/tests/test_gateway.py | 13 ++++++-------
+ 1 file changed, 6 insertions(+), 7 deletions(-)
+
+diff --git a/notebook/tests/test_gateway.py b/notebook/tests/test_gateway.py
+index d0cc84b09d..116b3db673 100644
+--- a/notebook/tests/test_gateway.py
++++ b/notebook/tests/test_gateway.py
+@@ -176,7 +176,7 @@ def test_gateway_get_kernelspecs(self):
+ with mocked_gateway:
+ response = self.request('GET', '/api/kernelspecs')
+ self.assertEqual(response.status_code, 200)
+- content = json.loads(response.content.decode('utf-8'), encoding='utf-8')
++ content = json.loads(response.content.decode('utf-8'))
+ kspecs = content.get('kernelspecs')
+ self.assertEqual(len(kspecs), 2)
+ self.assertEqual(kspecs.get('kspec_bar').get('name'), 'kspec_bar')
+@@ -186,7 +186,7 @@ def test_gateway_get_named_kernelspec(self):
+ with mocked_gateway:
+ response = self.request('GET', '/api/kernelspecs/kspec_foo')
+ self.assertEqual(response.status_code, 200)
+- kspec_foo = json.loads(response.content.decode('utf-8'), encoding='utf-8')
++ kspec_foo = json.loads(response.content.decode('utf-8'))
+ self.assertEqual(kspec_foo.get('name'), 'kspec_foo')
+
+ response = self.request('GET', '/api/kernelspecs/no_such_spec')
+@@ -257,7 +257,7 @@ def create_session(self, kernel_name):
+ # Create the kernel... (also tests get_kernel)
+ response = self.request('POST', '/api/sessions', **kwargs)
+ self.assertEqual(response.status_code, 201)
+- model = json.loads(response.content.decode('utf-8'), encoding='utf-8')
++ model = json.loads(response.content.decode('utf-8'))
+ self.assertEqual(model.get('path'), nb_path)
+ kernel_id = model.get('kernel').get('id')
+ # ensure its in the running_kernels and name matches.
+@@ -286,7 +286,7 @@ def is_kernel_running(self, kernel_id):
+ # Get list of running kernels
+ response = self.request('GET', '/api/kernels')
+ self.assertEqual(response.status_code, 200)
+- kernels = json.loads(response.content.decode('utf-8'), encoding='utf-8')
++ kernels = json.loads(response.content.decode('utf-8'))
+ self.assertEqual(len(kernels), len(running_kernels))
+ for model in kernels:
+ if model.get('id') == kernel_id:
+@@ -305,7 +305,7 @@ def create_kernel(self, kernel_name):
+
+ response = self.request('POST', '/api/kernels', **kwargs)
+ self.assertEqual(response.status_code, 201)
+- model = json.loads(response.content.decode('utf-8'), encoding='utf-8')
++ model = json.loads(response.content.decode('utf-8'))
+ kernel_id = model.get('id')
+ # ensure its in the running_kernels and name matches.
+ running_kernel = running_kernels.get(kernel_id)
+@@ -330,7 +330,7 @@ def restart_kernel(self, kernel_id):
+ with mocked_gateway:
+ response = self.request('POST', '/api/kernels/' + kernel_id + '/restart')
+ self.assertEqual(response.status_code, 200)
+- model = json.loads(response.content.decode('utf-8'), encoding='utf-8')
++ model = json.loads(response.content.decode('utf-8'))
+ restarted_kernel_id = model.get('id')
+ # ensure its in the running_kernels and name matches.
+ running_kernel = running_kernels.get(restarted_kernel_id)
+@@ -345,4 +345,3 @@ def delete_kernel(self, kernel_id):
+ response = self.request('DELETE', '/api/kernels/' + kernel_id)
+ self.assertEqual(response.status_code, 204)
+ self.assertEqual(response.reason, 'No Content')
+-
diff --git a/dev-python/notebook/notebook-6.0.3.ebuild b/dev-python/notebook/notebook-6.0.3.ebuild
index 2d0ffe8780d6..a92fb17d8b10 100644
--- a/dev-python/notebook/notebook-6.0.3.ebuild
+++ b/dev-python/notebook/notebook-6.0.3.ebuild
@@ -4,7 +4,7 @@
EAPI=7
DISTUTILS_USE_SETUPTOOLS=rdepend
-PYTHON_COMPAT=( python3_{6,7} )
+PYTHON_COMPAT=( python3_{6..9} )
PYTHON_REQ_USE="threads(+)"
inherit distutils-r1
@@ -43,7 +43,10 @@ BDEPEND="
)
"
-PATCHES=( "${FILESDIR}/${PN}"-5.7.0-no-mathjax.patch )
+PATCHES=(
+ "${FILESDIR}/${PN}"-5.7.0-no-mathjax.patch
+ "${FILESDIR}"/${P}-py39.patch
+)
distutils_enable_tests pytest