Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit 55b97c4

Browse files
committed
Automatically install and enable the classic notebook extension during package installation
1 parent 3b838f7 commit 55b97c4

File tree

7 files changed

+32
-1
lines changed

7 files changed

+32
-1
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
recursive-include jupyter_dash/nbextension *.json
2+
recursive-include jupyter_dash/nbextension/static *.js

jupyter_dash/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,13 @@
1+
import jupyter_dash.comms
12
from .jupyter_app import JupyterDash
3+
4+
5+
def _jupyter_nbextension_paths():
6+
return [
7+
{
8+
"section": "notebook",
9+
"src": "nbextension/static",
10+
"dest": "jupyter_dash",
11+
"require": "jupyter_dash/main",
12+
}
13+
]
File renamed without changes.

jupyter_dash/nbextension/__init__.py

Whitespace-only changes.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"load_extensions": {
3+
"jupyter_dash/main": true
4+
}
5+
}

setup.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,17 @@
55
version='0.0.1a1',
66
description="Dash support for the Jupyter notebook interface",
77
author='Plotly',
8-
packages=['jupyter_dash']
8+
packages=['jupyter_dash'],
9+
install_requires=['dash', 'requests', 'flask', 'retrying', 'ipython'],
10+
include_package_data=True,
11+
data_files=[
12+
# like `jupyter nbextension install --sys-prefix`
13+
("share/jupyter/nbextensions/jupyter_dash", [
14+
"jupyter_dash/nbextension/static/main.js",
15+
]),
16+
# like `jupyter nbextension enable --sys-prefix`
17+
("etc/jupyter/nbconfig/notebook.d", [
18+
"jupyter_dash/nbextension/jupyter_dash.json"
19+
]),
20+
]
921
)

0 commit comments

Comments
 (0)