From ddc7527aa8a7f49f9303bd07c9c2f5425a4392d9 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Wed, 22 Mar 2023 15:17:41 -0700 Subject: [PATCH 1/5] Try to fix Jupyter kernel name --- docs/source/conf.py | 1 + tools/deploy_documentation_dev.sh | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index 71ede9ecd..a2128c13b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -176,3 +176,4 @@ def avoid_duplicate_in_dispatch(app, obj, bound_method): def setup(app): app.connect('config-inited', _get_versions) app.connect('autodoc-before-process-signature', avoid_duplicate_in_dispatch) + app.add_config_value("jupyter_execute_default_kernel", "python", "env") diff --git a/tools/deploy_documentation_dev.sh b/tools/deploy_documentation_dev.sh index 35bc9d451..bf8b84eb0 100755 --- a/tools/deploy_documentation_dev.sh +++ b/tools/deploy_documentation_dev.sh @@ -20,6 +20,9 @@ sudo apt-get install -y ./rclone.deb RCLONE_CONFIG_PATH=$(rclone config file | tail -1) +# Show available Jupyter kernels +jupyter kernelspec list + # Build the documentation. RETWORKX_DEV_DOCS=1 tox -edocs From 846a8748ce77a676fb8cdd13a6e81caed5c15e54 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Wed, 22 Mar 2023 15:24:39 -0700 Subject: [PATCH 2/5] Display kernels in tox.ini --- tools/deploy_documentation_dev.sh | 3 --- tox.ini | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/tools/deploy_documentation_dev.sh b/tools/deploy_documentation_dev.sh index bf8b84eb0..35bc9d451 100755 --- a/tools/deploy_documentation_dev.sh +++ b/tools/deploy_documentation_dev.sh @@ -20,9 +20,6 @@ sudo apt-get install -y ./rclone.deb RCLONE_CONFIG_PATH=$(rclone config file | tail -1) -# Show available Jupyter kernels -jupyter kernelspec list - # Build the documentation. RETWORKX_DEV_DOCS=1 tox -edocs diff --git a/tox.ini b/tox.ini index 8f5e71656..78efb1eb7 100644 --- a/tox.ini +++ b/tox.ini @@ -47,6 +47,7 @@ deps = passenv = {[testenv]passenv} RETWORKX_DEV_DOCS RETWORKX_LEGACY_DOCS changedir = {toxinidir}/docs commands = + jupyter kernelspec list sphinx-build -W -b html source build/html {posargs} [testenv:black] From 7a9d02df9c9a4461103a3f7a32003cb98174e23e Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Wed, 22 Mar 2023 16:13:19 -0700 Subject: [PATCH 3/5] Install kernel because it is not installed apparently --- docs/source/conf.py | 2 +- tox.ini | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index a2128c13b..d2fc0ad40 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -176,4 +176,4 @@ def avoid_duplicate_in_dispatch(app, obj, bound_method): def setup(app): app.connect('config-inited', _get_versions) app.connect('autodoc-before-process-signature', avoid_duplicate_in_dispatch) - app.add_config_value("jupyter_execute_default_kernel", "python", "env") + app.add_config_value("jupyter_execute_default_kernel", "python3", "env") diff --git a/tox.ini b/tox.ini index 78efb1eb7..77451c244 100644 --- a/tox.ini +++ b/tox.ini @@ -47,6 +47,7 @@ deps = passenv = {[testenv]passenv} RETWORKX_DEV_DOCS RETWORKX_LEGACY_DOCS changedir = {toxinidir}/docs commands = + python -m ipykernel install --user jupyter kernelspec list sphinx-build -W -b html source build/html {posargs} From cd4b0babc175fe7dfb26e523891be11f85926f8c Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Wed, 22 Mar 2023 16:57:23 -0700 Subject: [PATCH 4/5] Add ipykernel to dependencies --- docs/source/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/requirements.txt b/docs/source/requirements.txt index c6e237f33..a960d2883 100644 --- a/docs/source/requirements.txt +++ b/docs/source/requirements.txt @@ -9,3 +9,4 @@ qiskit-sphinx-theme>=1.7 matplotlib>=3.4 sphinx-reredirects sphinxemoji +ipykernel From f2716251c39885861b2a1cbcdb525ac24eed9f25 Mon Sep 17 00:00:00 2001 From: Ivan Carvalho Date: Wed, 22 Mar 2023 20:55:33 -0700 Subject: [PATCH 5/5] Add correct way to set kernel name --- docs/source/conf.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index d2fc0ad40..be034aca7 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -115,6 +115,9 @@ u'rustworkx Contributors', 'manual'), ] +# Jupyter Sphinx options +jupyter_execute_default_kernel = "python3" + # Texinfo options texinfo_documents = [ @@ -176,4 +179,3 @@ def avoid_duplicate_in_dispatch(app, obj, bound_method): def setup(app): app.connect('config-inited', _get_versions) app.connect('autodoc-before-process-signature', avoid_duplicate_in_dispatch) - app.add_config_value("jupyter_execute_default_kernel", "python3", "env")