Skip to content

Commit bd9761c

Browse files
committed
Enable serverextension in CI! Add publish integration tests.
- Update README - also, ignore node_modules Right now we're not automatically configuring the jupyter server. This manifests as a situation where requests are sent to the endpoint expecting a json payload and it gets back the 404 html page (which it doesn't know how to process). The real solution to this is to autoinstall the extension, but that won't help in the development case so it needs to be documented.
1 parent 1676a8b commit bd9761c

File tree

5 files changed

+21
-2
lines changed

5 files changed

+21
-2
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ jobs:
7171
command: |
7272
. venv_packaged_integration/bin/activate
7373
# Install the dependencies for our integration tester
74+
jupyter serverextension enable --py bookstore
7475
npm i
7576
node ci/integration.js
7677

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -114,3 +114,5 @@ binder/*run*.ipynb
114114
jupyter_notebook_config.py
115115
jupyter_config.py
116116

117+
# node modules to ignore
118+
node_modules/

README.md

+10
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,16 @@ Since most people are on a regular filesystem, we'll start with writing to the `
4242

4343
---
4444

45+
## Publishing
46+
47+
The bookstore publishing endpoint is a serverextension to the classic Jupyter server.
48+
49+
This means if you are developing this you will need to explicitly enable it to use the endpoint.
50+
51+
To do so you run: `jupyter serverextension enable --py bookstore`.
52+
53+
If you wish to enable it only for your current environment, run: `jupyter serverextension enable --py bookstore --sys-prefix`.
54+
4555
## Installation
4656

4757
**bookstore** requires Python 3.6 or higher.

bookstore/handlers.py

-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ async def _publish(self, model, path):
6868
)
6969
self.log.info("Done with published write of %s", path)
7070

71-
self.log.info(obj)
72-
7371
self.set_status(201)
7472

7573
resp_content = {"s3path": full_s3_path}

ci/integration.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
const child_process = require("child_process");
12
const path = require("path");
23
const fs = require("fs");
34

@@ -167,6 +168,13 @@ const main = async () => {
167168
originalNotebook
168169
);
169170

171+
await jupyterServer.publishNotebook(
172+
"ci-published.ipynb",
173+
originalNotebook
174+
)
175+
176+
await comparePublishedNotebooks("ci-published.ipynb", originalNotebook);
177+
170178
const basicNotebook = {
171179
cells: [],
172180
nbformat: 4,

0 commit comments

Comments
 (0)