Skip to content
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

Backport PR #7244 on branch 7.0.x (Add documentation for updating notebook imports) #7245

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions docs/source/configuring/config_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ front-end Notebook client (i.e. the familiar notebook interface).
> - Related: [Configuring a language kernel](https://ipython.readthedocs.io/en/latest/install/kernel_install.html)
> to run in the Jupyter Server enables your server to run other languages, like R or Julia.

```{warning}
Jupyter Notebook 7 is now based on Jupyter Server. This may break some previous `notebook` imports you may have been using, such as `notebook.auth` or `notebook.notebookapp`.

Check out the [migration guide](../migrating/server-imports.md) to learn more on how to update these server imports.
```

(configure-nbextensions)=

## Notebook extensions
Expand Down
1 change: 1 addition & 0 deletions docs/source/migrate_to_notebook7.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ notebook_7_features.md

migrating/frontend-extensions.md
migrating/server-extensions.md
migrating/server-imports.md
migrating/custom-themes.md
migrating/multiple-interfaces.md
```
Expand Down
37 changes: 37 additions & 0 deletions docs/source/migrating/server-imports.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Server Imports in Notebook 7

Notebook 7 is now based on Jupyter Server, which lets users run multiple Jupyter frontends (e.g. Notebook, JupyterLab, NBClassic, etc.) on the same server.

Prior to Notebook 7, the Classic Notebook server included the server modules in the `notebook` package. This means it was possible to import the server modules from the `notebook` package, for example:

```python
from notebook.auth import passwd

passwd("foo")
```

Or:

```python
from notebook import notebookapp

notebookapp.list_running_servers()
```

In Notebook 7, these server modules are now exposed by the `jupyter_server` package. The code snippets above should be updated to:

```python
from jupyter_server.auth import passwd

passwd("foo")
```

And:

```python
from jupyter_server import serverapp

serverapp.list_running_servers()
```

These are just examples, so you may have to adjust your use of `notebook` imports based on the specific server modules you were using.
Loading