Skip to content

Commit 7539961

Browse files
committed
API doc: import batchspawner, not batchspawner.api
- importing batchspawner.api could become depreciated in the future, but importing "batchspawner" will always work (and imports .api within it). Recommend only importing batchspawner then. - Add clarifying comment in one of the docs.
1 parent 673072d commit 7539961

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This package formerly included WrapSpawner and ProfilesSpawner, which provide me
1919
```python
2020
c = get_config()
2121
c.JupyterHub.spawner_class = 'batchspawner.TorqueSpawner'
22-
import batchspawner.api
22+
import batchspawner # Even though not used, needed to register batchspawner interface
2323
```
2424
3. Depending on the spawner, additional configuration will likely be needed.
2525

@@ -53,7 +53,7 @@ to run Jupyter notebooks on an academic supercomputer cluster.
5353

5454
```python
5555
# Select the Torque backend and increase the timeout since batch jobs may take time to start
56-
import batchspawner.api
56+
import batchspawner
5757
c.JupyterHub.spawner_class = 'batchspawner.TorqueSpawner'
5858
c.Spawner.http_timeout = 120
5959

@@ -119,7 +119,7 @@ clusters, as well as an option to run a local notebook directly on the jupyterhu
119119

120120
```python
121121
# Same initial setup as the previous example
122-
import batchspawner.api
122+
import batchspawner
123123
c.JupyterHub.spawner_class = 'wrapspawner.ProfilesSpawner'
124124
c.Spawner.http_timeout = 120
125125
#------------------------------------------------------------------------------
@@ -175,7 +175,7 @@ Added (developer)
175175
Changed
176176

177177
* PR #58 changes logic of port selection, so that it is selected *after* the singleuser server starts. This means that the port number has to be conveyed back to JupyterHub. This requires the following changes:
178-
- `jupyterhub_config.py` *must* explicitely import `batchspawner.api`
178+
- `jupyterhub_config.py` *must* explicitely import `batchspawner`
179179
- If you override `Spawner.cmd`, note that the default command is now `batchspawner-singleuser`, not the default `jupyterhub-singleuser`. This is to add a hook to report the port number back to the hub.
180180
- If you have installed with `pip install -e`, you will have to re-install so that the new script `batchspawner-singleuser` is added to `$PATH`.
181181
* Update minimum requirements to JupyterHub 0.8.1 and Python 3.4.

0 commit comments

Comments
 (0)