From 81658a4f7f2ccd8c8f30385de69529b90ff9732d Mon Sep 17 00:00:00 2001 From: Mehmet Bektas Date: Fri, 7 Jul 2023 13:01:00 -0700 Subject: [PATCH 1/4] Update .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 4cf36e89..7f0d5a3e 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ __pycache__ env_installer/jlab_server/ env_installer/jlab_server.tar.gz + From c3d29d3871795443bfc36bc0a6a7d3e3b9ae385f Mon Sep 17 00:00:00 2001 From: Mehmet Bektas Date: Fri, 7 Jul 2023 22:38:23 -0700 Subject: [PATCH 2/4] fix notarize issue --- scripts/notarize.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/scripts/notarize.js b/scripts/notarize.js index 3bfda228..43f439f7 100644 --- a/scripts/notarize.js +++ b/scripts/notarize.js @@ -2,16 +2,11 @@ const { notarize } = require('electron-notarize'); -function isDevMode() { - return require.main.filename.indexOf('app.asar') === -1; -} - exports.default = async function notarizing(context) { const { electronPlatformName, appOutDir } = context; if ( electronPlatformName !== 'darwin' || - process.env.CSC_IDENTITY_AUTO_DISCOVERY === 'false' || - isDevMode() + process.env.CSC_IDENTITY_AUTO_DISCOVERY === 'false' ) { return; } From 40a4fbe2387d2a5f0cf7b1a971893fee89c18977 Mon Sep 17 00:00:00 2001 From: Mehmet Bektas Date: Fri, 7 Jul 2023 23:04:03 -0700 Subject: [PATCH 3/4] Update sign-osx-64.txt --- env_installer/sign-osx-64.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/env_installer/sign-osx-64.txt b/env_installer/sign-osx-64.txt index d216efc7..96cc2355 100644 --- a/env_installer/sign-osx-64.txt +++ b/env_installer/sign-osx-64.txt @@ -211,6 +211,7 @@ lib/python3.8/lib-dynload/_heapq.cpython-38-darwin.so lib/python3.8/lib-dynload/_codecs_jp.cpython-38-darwin.so lib/python3.8/site-packages/pycosat.cpython-38-darwin.so lib/python3.8/site-packages/unicodedata2.cpython-38-darwin.so +lib/python3.8/site-packages/_brotli.cpython-38-darwin.so lib/python3.8/site-packages/_cffi_backend.cpython-38-darwin.so lib/python3.8/site-packages/_ruamel_yaml.cpython-38-darwin.so lib/python3.8/site-packages/pvectorc.cpython-38-darwin.so From fe2d857c138de3e2cfc410c4ef3a351c20bb35ae Mon Sep 17 00:00:00 2001 From: Mehmet Bektas Date: Sun, 9 Jul 2023 22:35:57 -0700 Subject: [PATCH 4/4] add Python environment management documentation --- user-guide.md | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/user-guide.md b/user-guide.md index 6e205cee..a9260f13 100644 --- a/user-guide.md +++ b/user-guide.md @@ -92,7 +92,87 @@ You can delete the stored session data manually at any time by using the `Clear Clear History -## How to create a Custom Python Environment +# Python environment management using CLI + +JupyterLab Desktop CLI (`jlab`) provides several commands and options to manage Python environments for use in the application. Below is the list of environment management commands. + +### `jlab env info` + +Show app's Python environment configuration such as bundled Python environment installation path and default Python environment path. + +### `jlab env list` + +List Python environments available to the app. These are the environments discovered by the app or set by user. + +### `jlab env install [path]` + +Install the bundled Python environment. If the path argument is provided, then the environment is installed into the specified directory. Otherwise it is installed into the default installation path. Installed environment is automatically added to app's environments list to allow selection on the UI. If there is an existing installation, `--force` argument can be set to overwrite. + +Examples: + +```bash +# install to default directory +jlab env install +# install to /opt/jlab_server +jlab env install /opt/jlab_server +# install to /opt/jlab_server +jlab env install --path /opt/jlab_server +# install to /opt/jlab_server overwriting any existing installation +jlab env install /opt/jlab_server --force +``` + +### `jlab env create [package list]` + +Create a new conda or venv Python environment at the specified path. `jupyterlab` Python package is automatically installed since it is required by the desktop application. You can use `--exclude-jlab` to skip installation of `jupyterlab` package. A conda environment is created by default. If you would like to create venv environment, then add argument `--env-type venv` to the command. If there is an existing installation, `--force` argument can be set to overwrite. + +Examples: + +```bash +# create new conda environment at /opt/jlab_server +jlab env create /opt/jlab_server +# create new conda environment at /opt/jlab_server +jlab env create --path /opt/jlab_server +# create new venv environment +jlab env create /opt/jlab_server --env-type venv +# create new environment with jupyterlab, scikit-learn, pandas, numpy packages +jlab env create /opt/jlab_server scikit-learn pandas numpy +# create new environment with only numpy package +jlab env create /opt/jlab_server --exclude-jlab numpy +# create new conda environment at /opt/jlab_server overwriting any existing installation +jlab env create /opt/jlab_server --force +``` + +### `jlab env activate [path]` + +Activate a Python environment in system terminal. In order to activate app's default Python environment, skip the path argument. If the path argument is provided, then the environment at the specified directory is activated. + +Examples: + +```bash +# activate the default Python environment +jlab env activate +# activate the Python environment at /opt/jlab_server +jlab env activate /opt/jlab_server +``` + +Make sure to exit the terminal process when you are done with activated environment, by running `exit` command. + +### `jlab env update-registry` + +Update discovered and user set Python environments without launching UI. This command resolves the environment details using the paths stored in app's environment registry. This operation is automatically done at app launch but the command can be used to the same without launching the app. + +### `jlab env set-base-conda-env-path ` + +Set base conda environment path. Base conda environment is used to activate sub conda environments when launching JupyterLab server. + +Examples: + +```bash +# set base conda environment to /opt/base_conda +jlab env set-base-conda-env-path /opt/base_conda +``` + +# How to create a Custom Python Environment ### Using conda