From 7586f75f650f226b02435a38f28a6f464f58338d Mon Sep 17 00:00:00 2001 From: jahn Date: Tue, 26 Jan 2021 13:35:29 -0800 Subject: [PATCH 01/12] Change binder requirement --- binder/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binder/requirements.txt b/binder/requirements.txt index 0e18a46..985a63c 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1 +1 @@ -jupyterlab>=2.0 \ No newline at end of file +jupyterlab>=3.0 \ No newline at end of file From e28f313b02a550317a84ce9495a52caa6d952372 Mon Sep 17 00:00:00 2001 From: jahn Date: Tue, 26 Jan 2021 13:39:06 -0800 Subject: [PATCH 02/12] Change binder workspace --- binder/workspace.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/binder/workspace.json b/binder/workspace.json index b8e697b..f5375a6 100644 --- a/binder/workspace.json +++ b/binder/workspace.json @@ -1 +1 @@ -{"data":{"layout-restorer:data":{"main":{"dock":{"type":"tab-area","currentIndex":0,"widgets":["notebook:Untitled2.ipynb"]},"mode":"multiple-document","current":"notebook:Untitled2.ipynb"},"left":{"collapsed":false,"current":"code-snippet-extension","widgets":["filebrowser","running-sessions","command-palette","jp-property-inspector","tab-manager","code-snippet-extension","extensionmanager.main-view"]},"right":{"collapsed":true,"widgets":[]}},"file-browser-filebrowser:cwd":{"path":""},"notebook:Untitled2.ipynb":{"data":{"path":"Untitled2.ipynb","factory":"Notebook"}}},"metadata":{"id":"/lab"}} +{"data":{"layout-restorer:data":{"main":{"dock":{"type":"tab-area","currentIndex":1,"widgets":["notebook:Untitled.ipynb"]},"mode":"multiple-document","current":"notebook:Untitled.ipynb"},"left":{"collapsed":false,"current":"code-snippet-extension","widgets":["filebrowser","running-sessions","command-palette","jp-property-inspector","tab-manager","code-snippet-extension","extensionmanager.main-view"]},"right":{"collapsed":true,"widgets":[]}},"file-browser-filebrowser:cwd":{"path":""},"@jupyterlab/settingeditor-extension:plugin":{"sizes":[0.09057971014492754,0.9094202898550725],"container":{"plugin":"@jupyterlab/shortcuts-extension:shortcuts","sizes":[0.48376993166287013,0.5162300683371298]}},"notebook:Untitled.ipynb":{"data":{"path":"Untitled.ipynb","factory":"Notebook"}}},"metadata":{"id":"/lab"}} From 425ea4a7f70b2860eca62e4144827bf51bfc8bd7 Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 12:27:50 -0800 Subject: [PATCH 03/12] Add jupyter telemetry to requirements --- binder/requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/binder/requirements.txt b/binder/requirements.txt index 985a63c..1d7c7c6 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1 +1,2 @@ -jupyterlab>=3.0 \ No newline at end of file +jupyterlab>=3.0 +jupyter-telemetry>=0.1.0 \ No newline at end of file From 61487012872dcea6fc3dd68a217be9b1e6bc7530 Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 12:39:23 -0800 Subject: [PATCH 04/12] Test jupyterlab 3.0 build --- binder/postBuild | 50 ++++++++++++++++++++--------------------- binder/requirements.txt | 3 +-- 2 files changed, 26 insertions(+), 27 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index f58786f..b767442 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -8,39 +8,39 @@ python3 binder/postBuild """ -import subprocess -import sys -from pathlib import Path +# import subprocess +# import sys +# from pathlib import Path -ROOT = Path.cwd() +# ROOT = Path.cwd() -def _(*args, **kwargs): - """ Run a command, echoing the args +# def _(*args, **kwargs): +# """ Run a command, echoing the args - fails hard if something goes wrong - """ - print("\n\t", " ".join(args), "\n") - return_code = subprocess.call(args, **kwargs) - if return_code != 0: - print("\nERROR", return_code, " ".join(args)) - sys.exit(return_code) +# fails hard if something goes wrong +# """ +# print("\n\t", " ".join(args), "\n") +# return_code = subprocess.call(args, **kwargs) +# if return_code != 0: +# print("\nERROR", return_code, " ".join(args)) +# sys.exit(return_code) -# verify the environment is self-consistent before even starting -_(sys.executable, "-m", "pip", "check") +# # verify the environment is self-consistent before even starting +# _(sys.executable, "-m", "pip", "check") -# install the labextension -_(sys.executable, "-m", "pip", "install", "-e", ".") +# # install the labextension +# _(sys.executable, "-m", "pip", "install", "-e", ".") -# verify the environment the extension didn't break anything -_(sys.executable, "-m", "pip", "check") +# # verify the environment the extension didn't break anything +# _(sys.executable, "-m", "pip", "check") -# list the extensions -_("jupyter", "server", "extension", "list") +# # list the extensions +# _("jupyter", "server", "extension", "list") -# initially list installed extensions to determine if there are any surprises -_("jupyter", "labextension", "list") +# # initially list installed extensions to determine if there are any surprises +# _("jupyter", "labextension", "list") -print("JupyterLab with code_snippet is ready to run with:\n") -print("\tjupyter lab\n") +# print("JupyterLab with code_snippet is ready to run with:\n") +# print("\tjupyter lab\n") diff --git a/binder/requirements.txt b/binder/requirements.txt index 1d7c7c6..985a63c 100644 --- a/binder/requirements.txt +++ b/binder/requirements.txt @@ -1,2 +1 @@ -jupyterlab>=3.0 -jupyter-telemetry>=0.1.0 \ No newline at end of file +jupyterlab>=3.0 \ No newline at end of file From 96bb5b05e9f67bddd55b64285ce11414e80a8222 Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 12:50:50 -0800 Subject: [PATCH 05/12] Test extension installed --- binder/postBuild | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index b767442..5bb1d02 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -41,6 +41,11 @@ # # initially list installed extensions to determine if there are any surprises # _("jupyter", "labextension", "list") +pip install -e . -# print("JupyterLab with code_snippet is ready to run with:\n") -# print("\tjupyter lab\n") +jlpm + +jlpm build + +print("JupyterLab with code_snippet is ready to run with:\n") +print("\tjupyter lab\n") From 6eb31bd1b7630c24c86517fd8483d9743bc80a59 Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 12:52:48 -0800 Subject: [PATCH 06/12] Test extension installed --- binder/postBuild | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index 5bb1d02..c26eca0 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -8,44 +8,46 @@ python3 binder/postBuild """ -# import subprocess -# import sys -# from pathlib import Path +import subprocess +import sys +from pathlib import Path -# ROOT = Path.cwd() +ROOT = Path.cwd() -# def _(*args, **kwargs): -# """ Run a command, echoing the args +print(ROOT) -# fails hard if something goes wrong -# """ -# print("\n\t", " ".join(args), "\n") -# return_code = subprocess.call(args, **kwargs) -# if return_code != 0: -# print("\nERROR", return_code, " ".join(args)) -# sys.exit(return_code) +def _(*args, **kwargs): + """ Run a command, echoing the args -# # verify the environment is self-consistent before even starting + fails hard if something goes wrong + """ + print("\n\t", " ".join(args), "\n") + return_code = subprocess.call(args, **kwargs) + if return_code != 0: + print("\nERROR", return_code, " ".join(args)) + sys.exit(return_code) + +# verify the environment is self-consistent before even starting # _(sys.executable, "-m", "pip", "check") -# # install the labextension -# _(sys.executable, "-m", "pip", "install", "-e", ".") +# install the labextension +_(sys.executable, "-m", "pip", "install", "-e", ".") -# # verify the environment the extension didn't break anything +# verify the environment the extension didn't break anything # _(sys.executable, "-m", "pip", "check") -# # list the extensions +# list the extensions # _("jupyter", "server", "extension", "list") -# # initially list installed extensions to determine if there are any surprises +# initially list installed extensions to determine if there are any surprises # _("jupyter", "labextension", "list") -pip install -e . +# pip install -e . -jlpm +# jlpm -jlpm build +# jlpm build print("JupyterLab with code_snippet is ready to run with:\n") print("\tjupyter lab\n") From b599203e77f6791db20beb0fdb1a1d57261b9e2e Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 13:02:20 -0800 Subject: [PATCH 07/12] Remove unnecessary files or directories in binder --- binder/postBuild | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index c26eca0..f0e8bd8 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -43,11 +43,26 @@ _(sys.executable, "-m", "pip", "install", "-e", ".") # initially list installed extensions to determine if there are any surprises # _("jupyter", "labextension", "list") -# pip install -e . - -# jlpm - -# jlpm build - print("JupyterLab with code_snippet is ready to run with:\n") print("\tjupyter lab\n") + +# remove unnecessary directories when using the binder +rm -rf src +rm -rf style +rm -rf _temp_extension +rm -rf Design +rm -rf binder +rm -rf docs +rm -rf code_snippet +rm -rf code_snippet.egg-info +rm -rf schema +rm -rf node_modules +rm install.json +rm package.json +rm PROGRESS.md +rm setup.py +rm pyproject.toml +rm tsconfig.json +rm tsconfig.tsbuildinfo +rm yarn.lock +rm MANIFEST.in From 77f9ca900738668357f9f54b39bc4c35a444ff7c Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 13:06:14 -0800 Subject: [PATCH 08/12] Remove unnecessary files or directories in binder --- binder/postBuild | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index f0e8bd8..e9c8923 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -15,7 +15,7 @@ from pathlib import Path ROOT = Path.cwd() -print(ROOT) +print("Current Working dir:", ROOT) def _(*args, **kwargs): """ Run a command, echoing the args @@ -47,22 +47,22 @@ print("JupyterLab with code_snippet is ready to run with:\n") print("\tjupyter lab\n") # remove unnecessary directories when using the binder -rm -rf src -rm -rf style -rm -rf _temp_extension -rm -rf Design -rm -rf binder -rm -rf docs -rm -rf code_snippet -rm -rf code_snippet.egg-info -rm -rf schema -rm -rf node_modules -rm install.json -rm package.json -rm PROGRESS.md -rm setup.py -rm pyproject.toml -rm tsconfig.json -rm tsconfig.tsbuildinfo -rm yarn.lock -rm MANIFEST.in +rm -rf ./src +rm -rf ./style +rm -rf ./_temp_extension +rm -rf ./Design +rm -rf ./binder +rm -rf ./docs +rm -rf ./code_snippet +rm -rf ./code_snippet.egg-info +rm -rf ./schema +rm -rf ./node_modules +rm ./install.json +rm ./package.json +rm ./PROGRESS.md +rm ./setup.py +rm ./pyproject.toml +rm ./tsconfig.json +rm ./tsconfig.tsbuildinfo +rm ./yarn.lock +rm ./MANIFEST.in From 0cf033b223b34663523c636bcb9275909039ec26 Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 13:15:06 -0800 Subject: [PATCH 09/12] Remove unnecessary files or directories in binder --- binder/postBuild | 60 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index e9c8923..5478197 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -47,22 +47,44 @@ print("JupyterLab with code_snippet is ready to run with:\n") print("\tjupyter lab\n") # remove unnecessary directories when using the binder -rm -rf ./src -rm -rf ./style -rm -rf ./_temp_extension -rm -rf ./Design -rm -rf ./binder -rm -rf ./docs -rm -rf ./code_snippet -rm -rf ./code_snippet.egg-info -rm -rf ./schema -rm -rf ./node_modules -rm ./install.json -rm ./package.json -rm ./PROGRESS.md -rm ./setup.py -rm ./pyproject.toml -rm ./tsconfig.json -rm ./tsconfig.tsbuildinfo -rm ./yarn.lock -rm ./MANIFEST.in +_('rm', '-rf', './src') +_('rm', '-rf', './style') +_('rm', '-rf', './_temp_extension') +_('rm', '-rf', './Design') +_('rm', '-rf', './binder') +_('rm', '-rf', './docs') +_('rm', '-rf', './code_snippet') +_('rm', '-rf', './code_snippet.egg-info') +_('rm', '-rf', './schema') +_('rm', '-rf', './node_modules') +_('rm', './install.json') +_('rm', './package.json') +_('rm', './PROGRESS.md') +_('rm', './setup.py') +_('rm', './pyproject.toml') +_('rm', './tsconfig.json') +_('rm', './tsconfig.tsbuildinfo') +_('rm', './yarn.lock') +_('rm', './MANIFEST.in') + + + + +# rm -rf ./style +# rm -rf ./_temp_extension +# rm -rf ./Design +# rm -rf ./binder +# rm -rf ./docs +# rm -rf ./code_snippet +# rm -rf ./code_snippet.egg-info +# rm -rf ./schema +# rm -rf ./node_modules +# rm ./install.json +# rm ./package.json +# rm ./PROGRESS.md +# rm ./setup.py +# rm ./pyproject.toml +# rm ./tsconfig.json +# rm ./tsconfig.tsbuildinfo +# rm ./yarn.lock +# rm ./MANIFEST.in From 8b4276533496552491e7ed8f3ceaa0d18a3c8837 Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 13:20:09 -0800 Subject: [PATCH 10/12] Finished Binder --- binder/postBuild | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/binder/postBuild b/binder/postBuild index 5478197..59d5b7b 100755 --- a/binder/postBuild +++ b/binder/postBuild @@ -47,6 +47,7 @@ print("JupyterLab with code_snippet is ready to run with:\n") print("\tjupyter lab\n") # remove unnecessary directories when using the binder +_('rm', '-rf', './lib') _('rm', '-rf', './src') _('rm', '-rf', './style') _('rm', '-rf', './_temp_extension') @@ -66,25 +67,3 @@ _('rm', './tsconfig.json') _('rm', './tsconfig.tsbuildinfo') _('rm', './yarn.lock') _('rm', './MANIFEST.in') - - - - -# rm -rf ./style -# rm -rf ./_temp_extension -# rm -rf ./Design -# rm -rf ./binder -# rm -rf ./docs -# rm -rf ./code_snippet -# rm -rf ./code_snippet.egg-info -# rm -rf ./schema -# rm -rf ./node_modules -# rm ./install.json -# rm ./package.json -# rm ./PROGRESS.md -# rm ./setup.py -# rm ./pyproject.toml -# rm ./tsconfig.json -# rm ./tsconfig.tsbuildinfo -# rm ./yarn.lock -# rm ./MANIFEST.in From 0c21c9d394954386181edd98da37978fb09301cc Mon Sep 17 00:00:00 2001 From: jahn Date: Wed, 27 Jan 2021 13:24:14 -0800 Subject: [PATCH 11/12] Update binder --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa5ba85..e5860d4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Save, reuse, and share code snippets using JupyterLab Code Snippets -![Github Actions Status](https://github.com/jupytercalpoly/jupyterlab-code-snippets/workflows/Build/badge.svg) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupytercalpoly/jupyterlab-code-snippets.git/master?urlpath=lab) [![NPM Version](https://img.shields.io/npm/v/jupyterlab-code-snippets.svg?style=flat)](https://npmjs.org/package/jupyterlab-code-snippets 'View this project on npm') [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/jupytercalpoly/jupyterlab-code-snippets/blob/master/LICENSE) [![Documentation Status](https://readthedocs.org/projects/jupyterlab-code-snippets-documentation/badge/?version=latest)](https://jupyterlab-code-snippets-documentation.readthedocs.io/en/latest/?badge=latest) +![Github Actions Status](https://github.com/jupytercalpoly/jupyterlab-code-snippets/workflows/Build/badge.svg) [[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jahn96/jupyterlab-code-snippets.git/jupyterlab_update?urlpath=lab) [![NPM Version](https://img.shields.io/npm/v/jupyterlab-code-snippets.svg?style=flat)](https://npmjs.org/package/jupyterlab-code-snippets 'View this project on npm') [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/jupytercalpoly/jupyterlab-code-snippets/blob/master/LICENSE) [![Documentation Status](https://readthedocs.org/projects/jupyterlab-code-snippets-documentation/badge/?version=latest)](https://jupyterlab-code-snippets-documentation.readthedocs.io/en/latest/?badge=latest) This extension is a derivative of [Elyra](https://github.com/elyra-ai/elyra)'s original design and further developed by Jupyter Cal Poly Team. From 6e58e0d46cdff348490343c04bb8f71247cc63a6 Mon Sep 17 00:00:00 2001 From: Jay Ahn Date: Wed, 27 Jan 2021 13:24:58 -0800 Subject: [PATCH 12/12] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e5860d4..a23d6a6 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Save, reuse, and share code snippets using JupyterLab Code Snippets -![Github Actions Status](https://github.com/jupytercalpoly/jupyterlab-code-snippets/workflows/Build/badge.svg) [[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jahn96/jupyterlab-code-snippets.git/jupyterlab_update?urlpath=lab) [![NPM Version](https://img.shields.io/npm/v/jupyterlab-code-snippets.svg?style=flat)](https://npmjs.org/package/jupyterlab-code-snippets 'View this project on npm') [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/jupytercalpoly/jupyterlab-code-snippets/blob/master/LICENSE) [![Documentation Status](https://readthedocs.org/projects/jupyterlab-code-snippets-documentation/badge/?version=latest)](https://jupyterlab-code-snippets-documentation.readthedocs.io/en/latest/?badge=latest) +![Github Actions Status](https://github.com/jupytercalpoly/jupyterlab-code-snippets/workflows/Build/badge.svg) [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jahn96/jupyterlab-code-snippets.git/jupyterlab_update?urlpath=lab) [![NPM Version](https://img.shields.io/npm/v/jupyterlab-code-snippets.svg?style=flat)](https://npmjs.org/package/jupyterlab-code-snippets 'View this project on npm') [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/jupytercalpoly/jupyterlab-code-snippets/blob/master/LICENSE) [![Documentation Status](https://readthedocs.org/projects/jupyterlab-code-snippets-documentation/badge/?version=latest)](https://jupyterlab-code-snippets-documentation.readthedocs.io/en/latest/?badge=latest) This extension is a derivative of [Elyra](https://github.com/elyra-ai/elyra)'s original design and further developed by Jupyter Cal Poly Team.