-
-
Notifications
You must be signed in to change notification settings - Fork 423
change from using a build script to auto installing kernels and providing a jupyter path update function #1215
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,5 @@ | ||
| *.pyc | ||
| *.un~ | ||
| /build/ | ||
| /deps/deps.jl | ||
| /deps/build.log | ||
| /deps/JUPYTER | ||
| /deps/julia-* | ||
| *.jl.*.cov | ||
| Manifest*.toml |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,12 @@ Changelog](https://keepachangelog.com). | |
| patch release of Julia, but it does mean that IJulia will only create kernels | ||
| for each Julia minor release instead of each patch release. | ||
|
|
||
| ### Added | ||
| - Added [`update_jupyter_path()`](@ref) function to explicitly update the saved | ||
| Jupyter executable path preference. | ||
| - Added zero-argument [`installkernel()`](@ref) convenience method that installs | ||
| the default Julia kernel with `--project=@.`. | ||
|
|
||
| ### Fixed | ||
| - Fixed the display of `UnionAll` types such as `Pair.body` ([#1203]). | ||
| - Fixed a bug in the PythonCall extension that would break opening comms from | ||
|
|
@@ -29,6 +35,19 @@ Changelog](https://keepachangelog.com). | |
| fixed ([#1202]). | ||
|
|
||
| ### Changed | ||
| - Removed `Pkg.build("IJulia")` support. IJulia no longer uses a | ||
| build step for kernel installation. The build-time configuration system has | ||
|
||
| been replaced with runtime functions. Use [`installkernel()`](@ref) to install | ||
| or update kernels, and [`update_jupyter_path()`](@ref) to configure the | ||
| Jupyter executable path. | ||
| - IJulia now uses [Scratch.jl](https://github.com/JuliaPackaging/Scratch.jl) to | ||
| store configuration preferences instead of writing to `DEPOT_PATH/prefs/`. | ||
|
||
| - Kernel auto-installation (when calling `notebook()` or `jupyterlab()`) now | ||
| checks if the **default** kernel for the current Julia version exists. | ||
| If not, it automatically installs it. This auto-installation can be disabled | ||
| by setting the `IJULIA_NODEFAULTKERNEL` environment variable. Note that | ||
| explicit calls to `installkernel()` always install/update a kernel for the | ||
| current Julia version, regardless of the environment variable. | ||
| - Replaced JSON.jl with a vendored copy of | ||
| [JSONX](https://github.com/JuliaIO/JSON.jl/tree/master/vendor) ([#1200]). This | ||
| lets us remove one more dependency and remove all of the invalidations caused | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| IJulia.IJulia | ||
| IJulia.inited | ||
| IJulia.installkernel | ||
| IJulia.update_jupyter_path | ||
| ``` | ||
|
|
||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,17 +15,16 @@ | |
| ``` | ||
|
|
||
| !!! info | ||
| This process installs a | ||
| [kernel specification](https://jupyter-client.readthedocs.io/en/latest/kernels.html#kernelspecs) | ||
| for IJulia. The IJulia kernelspec, shorthand for kernel specification, | ||
| contains the instructions for launching a Julia kernel that a notebook | ||
| frontend (Jupyter, JupyterLab, nteract) can use. The kernelspec does not | ||
| install the notebook frontend. | ||
| The Julia kernel will be automatically installed the first time you run | ||
| `IJulia.notebook()` or `IJulia.jupyterlab()`, or you can install it manually | ||
| by running `IJulia.installkernel()`. The kernel specification contains the | ||
| instructions for launching a Julia kernel that a notebook frontend | ||
| (Jupyter, JupyterLab, nteract) can use. | ||
|
|
||
| IJulia respects the standard | ||
| [`JUPYTER_DATA_DIR`](https://docs.jupyter.org/en/stable/use/jupyter-directories.html#data-files) | ||
| environment variable, so you can set that before installation if you want | ||
| the kernel to be installed in a specific location. | ||
| environment variable, so you can set that before installing the kernel if you want | ||
| it to be installed in a specific location. | ||
|
|
||
| !!! warning | ||
| The command, `Pkg.add("IJulia")`, does not install Jupyter | ||
|
|
@@ -34,19 +33,26 @@ | |
| You can install Jupyter Notebook by following the Notebook's | ||
| installation instructions if you want. Conveniently, Jupyter | ||
| Notebook can also be installed automatically when you run | ||
| `IJulia.notebook()`. | ||
| `IJulia.notebook()`. | ||
| See [Running the Julia notebook](running.md#Running-the-IJulia-Notebook). | ||
|
|
||
| You can direct `IJulia.notebook()` to use a specific Jupyter | ||
| installation by setting `ENV["JUPYTER"]` to the path of the | ||
| `jupyter` program executable. This environment variable should | ||
| be set before `Pkg.add` or before running `Pkg.build("IJulia")`, | ||
| and it will remember your preference for subsequent updates. | ||
| installation by passing the path directly to `IJulia.update_jupyter_path()`, | ||
| or by setting `ENV["JUPYTER"]` before calling it. This preference will be | ||
| remembered for subsequent updates. For example: | ||
| ```julia | ||
| # Option 1: Pass path directly | ||
| IJulia.update_jupyter_path("/usr/local/bin/jupyter") | ||
|
|
||
| # Option 2: Set environment variable | ||
| ENV["JUPYTER"] = "/usr/local/bin/jupyter" | ||
| IJulia.update_jupyter_path() | ||
| ``` | ||
|
|
||
| ## Updating Julia and IJulia | ||
|
|
||
| Julia is improving rapidly, so it won't be long before you want to | ||
| update your packages or Julia to a more recent version. | ||
| update your packages or Julia to a more recent version. | ||
|
|
||
| ### Update packages | ||
|
|
||
|
|
@@ -66,7 +72,8 @@ for the most recent Julia). If you're using juliaup to manage Julia, then for | |
| every Julia *minor release* (1.11, 1.12, etc) you will need to explicitly update | ||
| the IJulia installation to tell Jupyter where to find the new Julia version: | ||
| ```julia | ||
| Pkg.build("IJulia") | ||
| using IJulia | ||
| IJulia.installkernel() | ||
| ``` | ||
|
|
||
| This is because IJulia creates default kernels for every minor version if it | ||
|
|
@@ -78,7 +85,7 @@ installation every time you install a new Julia binary (or do anything that | |
|
|
||
|
|
||
| !!! important | ||
| `Pkg.build("IJulia")` **must** be run at the Julia command line. | ||
| `IJulia.installkernel()` **must** be run in the Julia REPL. | ||
|
||
| It will error and fail if run within IJulia. | ||
|
|
||
| ## Installing and customizing kernels | ||
|
|
@@ -116,23 +123,27 @@ installkernel("Julia (4 threads)", env=Dict("JULIA_NUM_THREADS"=>"4")) | |
|
|
||
| The `env` keyword should be a `Dict` which maps environment variables to values. | ||
|
|
||
| To *prevent* IJulia from installing a default kernel when the package is built, | ||
| define the `IJULIA_NODEFAULTKERNEL` environment variable before adding or | ||
| building IJulia. | ||
| If you want to disable automatic installation of the default kernel (for example, if | ||
| you only want custom kernels), set the `IJULIA_NODEFAULTKERNEL` environment variable: | ||
|
|
||
| ## Low-level IPython Installations | ||
| ```julia | ||
| using IJulia | ||
|
|
||
| We recommend using IPython 7.15 or later as well as Python 3. | ||
| # Disable auto-installation of the default kernel | ||
| ENV["IJULIA_NODEFAULTKERNEL"] = "true" | ||
|
|
||
| ### Using legacy IPython 2.x version | ||
| # Install custom kernels | ||
| IJulia.installkernel("Julia O3", "-O3") | ||
| IJulia.installkernel("Julia (4 threads)", env=Dict("JULIA_NUM_THREADS"=>"4")) | ||
| ``` | ||
|
|
||
| We recognize that some users may need to use legacy IPython 2.x. You | ||
| can do this by checkout out the `ipython2` branch of the IJulia package: | ||
| With `IJULIA_NODEFAULTKERNEL` set, `IJulia.notebook()` will not auto-install the | ||
| default kernel. You can still manually install the default kernel by calling | ||
| `IJulia.installkernel()` without arguments. | ||
|
|
||
| ```julia | ||
| Pkg.checkout("IJulia", "ipython2") | ||
| Pkg.build("IJulia") | ||
| ``` | ||
| ## Low-level IPython Installations | ||
|
|
||
| We recommend using IPython 7.15 or later as well as Python 3. | ||
|
|
||
| ### Manual installation of IPython | ||
|
|
||
|
|
@@ -165,8 +176,8 @@ Once IPython 3.0+ and Julia 0.7+ are installed, you can install IJulia from a Ju | |
| Pkg.add("IJulia") | ||
| ``` | ||
|
|
||
| This will download IJulia and a few other prerequisites, and will set up a | ||
| Julia kernel for IPython. | ||
| This will download IJulia and a few other prerequisites. The Julia kernel will be | ||
| automatically installed the first time you run `IJulia.notebook()` or `IJulia.jupyterlab()`. | ||
|
|
||
| If the command above returns an error, you may need to run `Pkg.update()`, then | ||
| retry it, or possibly run `Pkg.build("IJulia")` to force a rebuild. | ||
| retry it. If you need to reinstall the kernel, run `IJulia.installkernel()`. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be in a new 1.33.0 section.