Skip to content

Commit cccaca0

Browse files
authored
Merge branch '3.0' into localization-kernel-output
2 parents 5cd1665 + ab5aefa commit cccaca0

File tree

115 files changed

+2773
-412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+2773
-412
lines changed

.github/workflows/main.yml

+16-12
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ jobs:
7373
restore-keys: |
7474
${{ runner.os }}-pip-
7575
- name: Install the Python dependencies
76-
run: python -m pip install jupyterlab
76+
run: |
77+
python -m pip install --upgrade pip
78+
python -m pip install jupyter_packaging
79+
python -m pip install --pre jupyterlab
7780
- name: Install the NPM dependencies
7881
run: |
7982
cd ${EXAMPLE_FOLDER}
@@ -91,9 +94,12 @@ jobs:
9194
- name: Build and check by extension
9295
run: |
9396
cd ${EXAMPLE_FOLDER}
94-
jlpm run build
95-
jupyter labextension install .
97+
pip install -e .
98+
jupyter labextension list 1>labextensions 2>&1
99+
cat labextensions
100+
cat labextensions | grep -i "@jupyterlab-examples/*.*OK"
96101
python -m jupyterlab.browser_check
102+
pip uninstall -y $(python setup.py --name)
97103
env:
98104
EXAMPLE_FOLDER: ${{ matrix.example }}
99105
shell: bash
@@ -145,8 +151,9 @@ jobs:
145151
${{ runner.os }}-pip-
146152
- name: Install the Python dependencies
147153
run: |
154+
python -m pip install --upgrade pip
148155
python -m pip install jupyter_packaging
149-
python -m pip install jupyterlab
156+
python -m pip install --pre jupyterlab
150157
- name: Install the NPM dependencies
151158
run: |
152159
cd advanced/server-extension
@@ -161,31 +168,29 @@ jobs:
161168
cd advanced/server-extension
162169
python setup.py sdist
163170
pip install jlab_ext_example --pre --find-links=dist --no-cache-dir
164-
jupyter lab build
165171
python -m jupyterlab.browser_check
166172
- name: Check extension as dev
167173
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
168174
run: |
169-
jupyter serverextension list 1>serverextensions 2>&1
175+
jupyter server extension list 1>serverextensions 2>&1
170176
cat serverextensions | grep "jlab_ext_example.*OK"
171177
jupyter labextension list 1>labextensions 2>&1
172178
cat labextensions | grep "@jupyterlab-examples/server-extension.*OK"
173179
- name: Clean extension installation
174180
run: |
175181
pip uninstall -y jlab_ext_example
176182
jupyter lab clean
177-
jupyter serverextension list
183+
jupyter server extension list
178184
jupyter labextension list
179185
- name: Build extension as dev
180186
run: |
181187
cd advanced/server-extension
182188
pip install -e .
183-
jupyter serverextension enable --py jlab_ext_example
184-
jupyter labextension install .
189+
jupyter server extension enable --py jlab_ext_example
185190
- name: Check extension as dev
186191
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
187192
run: |
188-
jupyter serverextension list 1>serverextensions 2>&1
193+
jupyter server extension list 1>serverextensions 2>&1
189194
cat serverextensions | grep "jlab_ext_example.*OK"
190195
jupyter labextension list 1>labextensions 2>&1
191196
cat labextensions | grep "@jupyterlab-examples/server-extension.*OK"
@@ -231,12 +236,11 @@ jobs:
231236
restore-keys: |
232237
${{ runner.os }}-pip-
233238
- name: Install the Python dependencies
234-
run: python -m pip install jupyterlab
239+
run: python -m pip install --pre jupyterlab
235240
- name: Bootstrap the jlpm deps
236241
run: jlpm
237242
- name: Build all the extensions
238243
run: |
239244
jlpm build-ext
240245
jlpm lint:check
241246
jlpm install-ext
242-
jlpm build-jlab

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ node_modules/
88
*.lock
99
# Ensure embedme does not run ont node_modules README.md files.
1010
**/node_modules/**/README.md
11+
12+
static

.prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ node_modules
22
**/node_modules
33
**/lib
44
**/package.json
5+
**/static

advanced/kernel-messaging/MANIFEST.in

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
include LICENSE
2+
include README.md
3+
include pyproject.toml
4+
include jupyter-config/jupyterlab_examples_kernel_messaging.json
5+
6+
include package.json
7+
include ts*.json
8+
9+
graft jupyterlab_examples_kernel_messaging/static
10+
11+
# Javascript files
12+
graft src
13+
graft style
14+
prune **/node_modules
15+
prune lib
16+
17+
# Patterns to exclude from any directory
18+
global-exclude *~
19+
global-exclude *.pyc
20+
global-exclude *.pyo
21+
global-exclude .git
22+
global-exclude .ipynb_checkpoints
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
import json
3+
import os.path as osp
4+
5+
from ._version import __version__
6+
7+
HERE = osp.abspath(osp.dirname(__file__))
8+
9+
with open(osp.join(HERE, 'static', 'package.json')) as fid:
10+
data = json.load(fid)
11+
12+
def _jupyter_labextension_paths():
13+
return [{
14+
'src': 'static',
15+
'dest': data['name']
16+
}]
17+
18+
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version_info = (0, 1, 0)
2+
__version__ = ".".join(map(str, version_info))

advanced/kernel-messaging/package.json

+33-21
Original file line numberDiff line numberDiff line change
@@ -25,40 +25,52 @@
2525
"url": "https://github.com/jupyterlab/extension-examples.git"
2626
},
2727
"scripts": {
28-
"build": "tsc",
29-
"clean": "rimraf lib tsconfig.tsbuildinfo",
30-
"install-ext": "jupyter labextension install . --no-build",
31-
"prepare": "jlpm run clean && jlpm run build",
28+
"build": "jlpm run build:lib",
29+
"build:all": "jlpm run build:lib && jlpm run build:labextension",
30+
"build:labextension": "jupyter labextension build .",
31+
"build:lib": "tsc",
32+
"clean": "jlpm run clean:lib",
33+
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
34+
"clean:labextension": "rimraf jupyterlab_examples_kernel_messaging/static",
35+
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
3236
"eslint": "eslint . --ext .ts,.tsx --fix",
3337
"eslint:check": "eslint . --ext .ts,.tsx",
34-
"watch": "tsc -w"
38+
"install:extension": "jupyter labextension develop --overwrite .",
39+
"prepare": "jlpm run clean && jlpm run build",
40+
"watch": "run-p watch:src watch:labextension",
41+
"watch:labextension": "jupyter labextension watch .",
42+
"watch:src": "tsc -w"
3543
},
3644
"dependencies": {
37-
"@jupyterlab/application": "^2.0.0",
38-
"@jupyterlab/launcher": "^2.0.0",
39-
"@jupyterlab/mainmenu": "^2.0.0",
40-
"@jupyterlab/nbformat": "^2.0.0",
41-
"@lumino/algorithm": "^1.2.3",
42-
"@lumino/coreutils": "^1.3.1",
45+
"@jupyterlab/application": "~3.0.0-beta.4",
46+
"@jupyterlab/launcher": "~3.0.0-beta.4",
47+
"@jupyterlab/mainmenu": "~3.0.0-beta.4",
48+
"@jupyterlab/nbformat": "~3.0.0-beta.4",
49+
"@lumino/algorithm": "^1.3.3",
50+
"@lumino/coreutils": "^1.5.3",
4351
"@lumino/datagrid": "^0.5.2",
44-
"@lumino/disposable": "^1.3.1",
45-
"@lumino/widgets": "^1.11.0"
52+
"@lumino/disposable": "^1.4.3",
53+
"@lumino/widgets": "^1.14.0"
4654
},
4755
"devDependencies": {
48-
"@typescript-eslint/eslint-plugin": "^2.21.0",
49-
"@typescript-eslint/parser": "^2.21.0",
50-
"eslint": "^6.8.0",
51-
"eslint-config-prettier": "^6.10.0",
56+
"@jupyterlab/builder": "^3.0.0-beta.4",
57+
"@typescript-eslint/eslint-plugin": "^2.27.0",
58+
"@typescript-eslint/parser": "^2.27.0",
59+
"eslint": "^7.5.0",
60+
"eslint-config-prettier": "^6.10.1",
5261
"eslint-plugin-jsdoc": "^22.0.0",
5362
"eslint-plugin-prettier": "^3.1.2",
5463
"eslint-plugin-react": "^7.18.3",
55-
"rimraf": "^3.0.0",
56-
"typescript": "~3.7.5"
64+
"npm-run-all": "^4.1.5",
65+
"prettier": "^1.19.0",
66+
"rimraf": "^3.0.2",
67+
"typescript": "~3.9.0"
5768
},
5869
"sideEffects": [
5970
"style/*.css"
6071
],
6172
"jupyterlab": {
62-
"extension": true
73+
"extension": true,
74+
"outputDir": "jupyterlab_examples_kernel_messaging/static"
6375
}
64-
}
76+
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build-system]
2+
requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"]
3+
build-backend = "setuptools.build_meta"

advanced/kernel-messaging/setup.py

+85
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
"""
2+
jupyterlab_examples_kernel_messaging setup
3+
"""
4+
import os
5+
6+
from jupyter_packaging import (
7+
create_cmdclass, install_npm, ensure_targets,
8+
combine_commands, get_version,
9+
)
10+
import setuptools
11+
12+
HERE = os.path.abspath(os.path.dirname(__file__))
13+
14+
# The name of the project
15+
name="jupyterlab_examples_kernel_messaging"
16+
17+
# Get our version
18+
version = get_version(os.path.join(name, "_version.py"))
19+
20+
lab_path = os.path.join(HERE, name, "static")
21+
22+
# Representative files that should exist after a successful build
23+
jstargets = [
24+
os.path.join(HERE, "lib", "index.js"),
25+
os.path.join(HERE, name, "static", "package.json"),
26+
]
27+
28+
package_data_spec = {
29+
name: [
30+
"*"
31+
]
32+
}
33+
34+
labext_name = "@jupyterlab-examples/kernel-messaging"
35+
36+
data_files_spec = [
37+
("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"),
38+
]
39+
40+
cmdclass = create_cmdclass("jsdeps",
41+
package_data_spec=package_data_spec,
42+
data_files_spec=data_files_spec
43+
)
44+
45+
cmdclass["jsdeps"] = combine_commands(
46+
install_npm(HERE, build_cmd="build:all", npm=["jlpm"]),
47+
ensure_targets(jstargets),
48+
)
49+
50+
with open("README.md", "r") as fh:
51+
long_description = fh.read()
52+
53+
setup_args = dict(
54+
name=name,
55+
version=version,
56+
url="https://github.com/jupyterlab/extension-examples.git",
57+
author="Project Jupyter Contributors",
58+
description="minimal lab example",
59+
long_description= long_description,
60+
long_description_content_type="text/markdown",
61+
cmdclass= cmdclass,
62+
packages=setuptools.find_packages(),
63+
install_requires=[
64+
"jupyterlab~=3.0.0b4",
65+
],
66+
zip_safe=False,
67+
include_package_data=True,
68+
python_requires=">=3.6",
69+
license="BSD-3-Clause",
70+
platforms="Linux, Mac OS X, Windows",
71+
keywords=["Jupyter", "JupyterLab"],
72+
classifiers=[
73+
"License :: OSI Approved :: BSD License",
74+
"Programming Language :: Python",
75+
"Programming Language :: Python :: 3",
76+
"Programming Language :: Python :: 3.6",
77+
"Programming Language :: Python :: 3.7",
78+
"Programming Language :: Python :: 3.8",
79+
"Framework :: Jupyter",
80+
],
81+
)
82+
83+
84+
if __name__ == "__main__":
85+
setuptools.setup(**setup_args)

advanced/kernel-output/MANIFEST.in

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
include LICENSE
2+
include README.md
3+
include pyproject.toml
4+
include jupyter-config/jupyterlab_examples_kernel_output.json
5+
6+
include package.json
7+
include ts*.json
8+
9+
graft jupyterlab_examples_kernel_output/static
10+
11+
# Javascript files
12+
graft src
13+
graft style
14+
prune **/node_modules
15+
prune lib
16+
17+
# Patterns to exclude from any directory
18+
global-exclude *~
19+
global-exclude *.pyc
20+
global-exclude *.pyo
21+
global-exclude .git
22+
global-exclude .ipynb_checkpoints
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
import json
3+
import os.path as osp
4+
5+
from ._version import __version__
6+
7+
HERE = osp.abspath(osp.dirname(__file__))
8+
9+
with open(osp.join(HERE, 'static', 'package.json')) as fid:
10+
data = json.load(fid)
11+
12+
def _jupyter_labextension_paths():
13+
return [{
14+
'src': 'static',
15+
'dest': data['name']
16+
}]
17+
18+
19+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
version_info = (0, 1, 0)
2+
__version__ = ".".join(map(str, version_info))

0 commit comments

Comments
 (0)