Skip to content

This is a fork of google/swift-jupyter. It is made possible to use Jupyterlab (as well as Jupyter Notebook) with most up-to-date Swift toolchain.

License

Notifications You must be signed in to change notification settings

liuliu/swift-jupyter

 
 

Repository files navigation

Swift-Jupyter

This is a fork of google/swift-jupyter. It is made possible to use Jupyterlab (as well as Jupyter Notebook) with most up-to-date Swift toolchain.

This fork made several significant changes to original repository organization. It biased towards using Bazel as code and dependency management tool. This fork is fully separated from Swift for TensorFlow project and is actively maintained to keep everything working with up-to-date Swift toolchain.

Right now, this fork worked well with Swift from 5.4.x to 5.5.x on Linux without any tweaks (if installed to /opt/swift). It is tested with Ubuntu 20.04 distribution, but should work with other flavors.

Because both the notebook integration and PythonKit are used actively with one of my side business, the continuing maintenance of this repository can be assured.

I do want to make this work on macOS. It should be only a few OS / toolchain detection script away.

Getting Started

Requirements

Operating system:

  • Ubuntu 20.04 (64-bit); OR
  • Other operating systems may work, but you will have to build Swift from sources.

Dependencies:

  • Bazel
  • Python 3

Installation

Extract the Swift toolchain to /opt/swift.

Inside the swift-jupyter repository:

./scripts/bazel/setup_clang.sh /usr/local

Note: /usr/local should be where your bin/llvm-config binary resides.

Now you can run Jupyterlab:

SWIFTPATH=/opt/swift bazel run //lab:bootup -- --notebook-dir $PWD
<