Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Commit 5f46228

Browse files
authored
Merge pull request #54 from jtpio/resource-usage
Depend on jupyter-resource-usage
2 parents c1e4e0e + 564fb6f commit 5f46228

File tree

7 files changed

+114
-16
lines changed

7 files changed

+114
-16
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
- name: Install JupyterLab
2828
run: |
2929
python -m pip install jupyterlab --pre
30-
python -m pip install nbresuse
3130
3231
- name: Install the extension
3332
run: |

.github/workflows/packaging.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: Packaging
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: '*'
8+
9+
env:
10+
PIP_DISABLE_PIP_VERSION_CHECK: 1
11+
12+
defaults:
13+
run:
14+
shell: bash -l {0}
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Install node
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: '14.x'
26+
- name: Install Python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: '3.9'
30+
architecture: 'x64'
31+
- name: Install dependencies
32+
run: |
33+
python -m pip install --upgrade pip wheel
34+
python -m pip install setuptools jupyter_packaging "jupyterlab>=3,<4"
35+
- name: Build pypi distributions
36+
run: |
37+
python setup.py sdist bdist_wheel
38+
- name: Build npm distributions
39+
run: |
40+
jlpm lerna exec -- npm pack
41+
cp packages/*/*.tgz dist
42+
- name: Build checksum file
43+
run: |
44+
cd dist
45+
sha256sum * | tee SHA256SUMS
46+
- name: Upload distributions
47+
uses: actions/upload-artifact@v2
48+
with:
49+
name: dist ${{ github.run_number }}
50+
path: ./dist
51+
52+
install:
53+
runs-on: ${{ matrix.os }}-latest
54+
needs: [build]
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
os: [ubuntu, macos, windows]
59+
python: ['3.6', '3.9']
60+
include:
61+
- python: '3.6'
62+
dist: 'jupyterlab-system-monitor*.tar.gz'
63+
- python: '3.9'
64+
dist: 'jupyterlab_system_monitor*.whl'
65+
- os: windows
66+
py_cmd: python
67+
- os: macos
68+
py_cmd: python3
69+
- os: ubuntu
70+
py_cmd: python
71+
steps:
72+
- name: Install Python
73+
uses: actions/setup-python@v2
74+
with:
75+
python-version: ${{ matrix.python }}
76+
architecture: 'x64'
77+
- uses: actions/download-artifact@v2
78+
with:
79+
name: dist ${{ github.run_number }}
80+
path: ./dist
81+
- name: Install the prerequisites
82+
run: |
83+
${{ matrix.py_cmd }} -m pip install pip wheel
84+
- name: Install the package
85+
run: |
86+
cd dist
87+
${{ matrix.py_cmd }} -m pip install -vv ${{ matrix.dist }}
88+
- name: Validate environment
89+
run: |
90+
${{ matrix.py_cmd }} -m pip freeze
91+
${{ matrix.py_cmd }} -m pip check
92+
- name: Validate the install
93+
run: |
94+
jupyter labextension list
95+
jupyter labextension list 2>&1 | grep -ie "jupyterlab-system-monitor.*enabled.*ok" -

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
JupyterLab extension to display system information (memory and cpu usage).
88

9-
Provides an alternative frontend for the `nbresuse` metrics: [https://github.com/yuvipanda/nbresuse](https://github.com/yuvipanda/nbresuse)
9+
Provides an alternative frontend for the `jupyter-resource-usage` metrics: [https://github.com/jupyter-server/jupyter-resource-usage](https://github.com/jupyter-server/jupyter-resource-usage)
1010

1111
![screencast](./doc/screencast.gif)
1212

@@ -24,7 +24,7 @@ This extension was originally developed as part of the [jupyterlab-topbar](https
2424

2525
## Installation
2626

27-
This extension requires the `nbresuse` package and the `jupyterlab-topbar-extension` extension for JupyterLab.
27+
This extension requires the `jupyter-resource-usage` package and the `jupyterlab-topbar-extension` extension for JupyterLab.
2828

2929
**Note: This extension is not compatible with `nbresuse==0.3.4`**.
3030

@@ -61,7 +61,7 @@ conda install -c conda-forge nodejs
6161

6262
You can set the memory and cpu limits (but not enforce it) to display the indicator in the top bar.
6363

64-
For more info, check the [memory limit](https://github.com/yuvipanda/nbresuse#memory-limit) in the [nbresuse](https://github.com/yuvipanda/nbresuse) repository.
64+
For more info, check the [memory limit](https://github.com/jupyter-server/jupyter-resource-usage#memory-limit) in the [nbresuse](https://github.com/jupyter-server/jupyter-resource-usage) repository.
6565

6666
Edit `~/.jupyter/jupyter_notebook_config.py` (note: see [here](https://jupyter-notebook.readthedocs.io/en/stable/config.html#config-file-and-command-line-options) if you do not have a config file:
6767

@@ -101,7 +101,7 @@ You can change the label and refresh rate in JupyterLab's advanced settings edit
101101

102102
## Troubleshooting
103103

104-
If you are experiencing issues with the memory and cpu indicators not being displayed, make sure to check the [nbresuse changelog](https://github.com/yuvipanda/nbresuse/blob/master/CHANGELOG.md) for any breaking changes from major releases.
104+
If you are experiencing issues with the memory and cpu indicators not being displayed, make sure to check the [nbresuse changelog](https://github.com/jupyter-server/jupyter-resource-usage/blob/master/CHANGELOG.md) for any breaking changes from major releases.
105105

106106
## Development
107107

binder/environment.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ channels:
33
- conda-forge
44
dependencies:
55
- python=3
6-
- jupyterlab=2
7-
- nbresuse=0.3.6
6+
- jupyterlab=3
7+
- jupyter-resource-usage=0.5
88
- nodejs

packages/system-monitor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"conda"
6565
],
6666
"base": {
67-
"name": "nbresuse"
67+
"name": "jupyter-resource-usage"
6868
}
6969
}
7070
},

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[build-system]
2-
requires = ["jupyter_packaging~=0.7.0", "jupyterlab>=3.0.0rc10,==3.*", "setuptools>=40.8.0", "wheel"]
2+
requires = ["jupyter_packaging~=0.7.9", "jupyterlab>=3.0.0rc10,==3.*", "setuptools>=40.8.0", "wheel"]
33
build-backend = "setuptools.build_meta"

setup.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
"""
22
jupyterlab-system-monitor setup
33
"""
4-
import json
54
import os
65

76
from jupyter_packaging import (
87
create_cmdclass, install_npm, ensure_targets,
9-
combine_commands, get_version,
8+
combine_commands, get_version, skip_if_exists
109
)
1110
import setuptools
1211

@@ -21,7 +20,6 @@
2120

2221
# Representative files that should exist after a successful build
2322
jstargets = [
24-
os.path.join(HERE, "packages", "system-monitor", "lib", "index.js"),
2523
os.path.join(lab_path, "package.json"),
2624
]
2725

@@ -43,11 +41,17 @@
4341
data_files_spec=data_files_spec
4442
)
4543

46-
cmdclass["jsdeps"] = combine_commands(
44+
js_command = combine_commands(
4745
install_npm(HERE, build_cmd="build:prod", npm=["jlpm"]),
4846
ensure_targets(jstargets),
4947
)
5048

49+
is_repo = os.path.exists(os.path.join(HERE, ".git"))
50+
if is_repo:
51+
cmdclass["jsdeps"] = js_command
52+
else:
53+
cmdclass["jsdeps"] = skip_if_exists(jstargets, js_command)
54+
5155
with open("README.md", "r") as fh:
5256
long_description = fh.read()
5357

@@ -62,9 +66,9 @@
6266
cmdclass= cmdclass,
6367
packages=setuptools.find_packages(),
6468
install_requires=[
65-
"jupyterlab>=3.0.0rc10,==3.*",
66-
"jupyterlab-topbar>=0.6.0,<0.7.0",
67-
"nbresuse>=0.4.0,<0.5.0"
69+
"jupyterlab~=3.0",
70+
"jupyterlab-topbar~=0.6",
71+
"jupyter-resource-usage~=0.5"
6872
],
6973
zip_safe=False,
7074
include_package_data=True,

0 commit comments

Comments
 (0)