Skip to content

Commit 9ff7d3f

Browse files
authored
Merge pull request #9 from yuvipanda/auto-install
Automatically install & enable extensions
2 parents 237b46e + 199e7c0 commit 9ff7d3f

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ You can currently install this package from PyPI.
1515
pip install nbresuse
1616
```
1717

18-
Once installed, you need to enable it for use in your notebook
18+
**If your notebook version is < 5.3**, you need to enable the extension manually.
19+
1920
```
2021
jupyter serverextension enable --py nbresuse --sys-prefix
2122
jupyter nbextension install --py nbresuse --sys-prefix

nbresuse/etc/nbextension.json

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

nbresuse/etc/serverextension.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"NotebookApp": {
3+
"nbserver_extensions": {
4+
"nbresuse": true
5+
}
6+
}
7+
}
8+

setup.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
from glob import glob
12
import setuptools
23

34
setuptools.setup(
45
name="nbresuse",
5-
version='0.2.0',
6+
version='0.3.0',
67
url="https://github.com/yuvipanda/nbresuse",
78
author="Yuvi Panda",
89
description="Simple Jupyter extension to show how much resources (RAM) your notebook is using",
@@ -11,5 +12,11 @@
1112
'psutil',
1213
'notebook',
1314
],
14-
package_data={'nbresuse': ['static/*']},
15+
data_files=[
16+
('share/jupyter/nbextensions/nbresuse', glob('nbresuse/static/*')),
17+
('etc/jupyter/jupyter_notebook_config.d', ['nbresuse/etc/serverextension.json']),
18+
('etc/jupyter/nbconfig/notebook.d', ['nbresuse/etc/nbextension.json'])
19+
],
20+
zip_safe=False,
21+
include_package_data=True
1522
)

0 commit comments

Comments
 (0)