Skip to content

Commit

Permalink
Merge pull request #191 from mbektas/jlab3_upgrade
Browse files Browse the repository at this point in the history
Upgrade to JupyterLab 3
  • Loading branch information
Steven Silvester authored Sep 13, 2021
2 parents d7fbbed + a7d8295 commit f653b93
Show file tree
Hide file tree
Showing 38 changed files with 6,853 additions and 5,184 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ dist
lib
node_modules
.cache
.vscode
.vscode/*
!.vscode/launch.json
*.py[co]
__pycache__
*.egg-info
Expand All @@ -20,3 +21,5 @@ __pycache__
.idea/

*.log

env_installer/JupyterLab*[.sh,.exe]
31 changes: 31 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"version": "0.1.0",
"configurations": [
{
"name": "Debug Electron App",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
},
"args" : ["."],
"outputCapture": "std",
"preLaunchTask": "npm: build"
},
{
"name": "Debug Electron App without Build",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder}",
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron",
"windows": {
"runtimeExecutable": "${workspaceFolder}/node_modules/.bin/electron.cmd"
},
"args" : ["."],
"outputCapture": "std"
}
]
}

26 changes: 15 additions & 11 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
BSD 3-Clause License

Copyright (c) 2017, Project Jupyter Contributors
Copyright (c) 2015-2021 Project Jupyter Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Expand All @@ -27,3 +25,9 @@ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Semver File License
===================

The semver.py file is from https://github.com/podhmo/python-semver
which is licensed under the "MIT" license. See the semver.py file for details.
68 changes: 54 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,66 @@
# Jupyterlab App
# JupyterLab App

[![Build Status](https://travis-ci.org/jupyterlab/jupyterlab_app.svg?branch=master)](https://travis-ci.org/jupyterlab/jupyterlab_app)
A desktop application for [JupyterLab](https://github.com/jupyterlab/jupyterlab), based on [Electron](https://www.electronjs.org/).

## Build dependencies

A desktop application for [JupyterLab](https://github.com/jupyterlab/jupyterlab), based on [Electron](https://electron.atom.io/).

### Build dependencies
- [conda](https://docs.conda.io/en/latest/miniconda.html)

You can install miniconda from https://docs.conda.io/en/latest/miniconda.html

#### Linux
- [(conda) Constructor](https://github.com/conda/constructor) to bundle JupyterLab App Server into the stand-alone application. You can install Constructor using:

You will need the development packages of libcairo, libjpeg, and libgif. In Debian-based distributions, these are provided by the `libcairo2-dev`, `libjpeg8-dev`, and `libgif-dev` packages.
`conda install constructor`

### Getting started
- nodejs

1. run `git clone [email protected]:jupyterlab/jupyterlab_app.git`
2. run `yarn install` or `npm install`
3. run `yarn build:all` or `npm run build:all`
You can install from https://nodejs.org/en/download/ or run `conda install nodejs`

### Building for distribution
- yarn

To test building for distribution you can install [Docker](https://docs.docker.com/engine/installation/) and run `yarn dockerdist:platform` where "platform" is either "linux" or "win". To build for macOS a macOS computer is required.
Install using `npm install --global yarn`

If you don't want to user Docker but instead want to build locally, there are a few [dependencies](https://github.com/electron-userland/electron-builder/wiki/Multi-Platform-Build) you're required to install.
## Local development

Regarding releasing please check out [release](Release.md)
JupyterLab App bundles JupyterLab front-end and a conda environment as JupyterLab App Server as its backend into an Electron application.

`<platform>`: mac, linux or win

- Get the project source code

`git clone https://github.com/jupyterlab/jupyterlab_app.git`

- Install dependencies and build JupyterLab App

`yarn`

`yarn build`

- Create the JupyterLab App Server installer using

`yarn create_env_installer:<platform>`

Installer will be created in one of `env_installer/JupyterLabAppServer<version>-MacOSX-x86_64.sh`, `env_installer/JupyterLabAppServer-<version>-Linux-x86_64.sh`, `env_installer/JupyterLabAppServer-<version>-Windows-x86_64.exe` based on your platform

- Run the installer to install the JupyterLab App Server. Make sure to set install location to `jlab_server` directory that is at the same level as `jupyterlab_app` project source code

- Now you can launch the JupyterLab App locally using:

`yarn start`

## Building for distribution

- Build the application

`yarn run clean && yarn build`

- Create JupyterLab App Server installer

`yarn create_env_installer:<platform>`

- Create JupyterLab App installer which will also bundle JupyterLab App Server installer.

`yarn dist:<platform>`

App Installer will be created in `dist/JupyterLab.pkg` (macOS), `dist/JupyterLab.deb` (Debian, Ubuntu), `dist/JupyterLab.rpm` (Red Hat, Fedora) and `dist/JupyterLab-Setup.exe` (Windows) based on the platform
1 change: 1 addition & 0 deletions electron-builder-scripts/linux_after_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
./opt/JupyterLab/resources/env_installer/JupyterLabAppServer-3.1.10-Linux-x86_64.sh -b -p "/opt/JupyterLab/resources/jlab_server"
1 change: 1 addition & 0 deletions electron-builder-scripts/linux_before_remove.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rm -rf "/opt/JupyterLab/resources/jlab_server"
5 changes: 5 additions & 0 deletions electron-builder-scripts/postinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

"$2/JupyterLab.app/Contents/Resources/env_installer/JupyterLabAppServer-3.1.10-MacOSX-x86_64.sh" -b -p "$2/JupyterLab.app/Contents/Resources/jlab_server"

exit 0
9 changes: 9 additions & 0 deletions electron-builder-scripts/wininstall.nsh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
!macro preInit
SetRegView 64
WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\JupyterLab"
WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "C:\JupyterLab"
!macroend

!macro customInstall
ExecWait "$INSTDIR\resources\env_installer\JupyterLabAppServer-3.1.10-Windows-x86_64.exe"
!macroend
22 changes: 22 additions & 0 deletions env_installer/construct.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: JupyterLabAppServer
version: 3.1.10
company: "Project Jupyter"

channels:
- https://conda.anaconda.org/conda-forge
- http://repo.anaconda.com/pkgs/main/

specs:
- python 3.8*
- conda
- numpy
- scipy
- pandas
- jupyterlab 3.1.10
- ipywidgets 7.6.4
- matplotlib

default_prefix: "%HOMEDRIVE%\\JupyterLab\\resources\\jlab_server"
default_prefix_all_users: "%HOMEDRIVE%\\JupyterLab\\resources\\jlab_server"

license_file: ../LICENSE
Loading

0 comments on commit f653b93

Please sign in to comment.