From 799c85bc9e24629df8e3def4be627fd7a9ff66db Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 9 Sep 2020 15:39:09 -0500 Subject: [PATCH 1/8] ignore static files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 8f0a97df..806685a5 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ node_modules/ *.lock # Ensure embedme does not run ont node_modules README.md files. **/node_modules/**/README.md + +static From 063679ae79f462db08de2cabeaaf0353e32d77de Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 9 Sep 2020 16:41:50 -0500 Subject: [PATCH 2/8] Auto-upgrade server ext package.json --- advanced/server-extension/package.json | 42 +++++++++++++++----------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/advanced/server-extension/package.json b/advanced/server-extension/package.json index 9824feec..50fa1f26 100644 --- a/advanced/server-extension/package.json +++ b/advanced/server-extension/package.json @@ -26,36 +26,41 @@ }, "scripts": { "build": "jlpm run build:lib", - "build:labextension": "cd jlab_ext_example && rimraf labextension && mkdirp labextension && cd labextension && npm pack ../..", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", "build:lib": "tsc", - "build:all": "jlpm run build:labextension", "clean": "jlpm run clean:lib", - "clean:lib": "rimraf lib tsconfig.tsbuildinfo", - "clean:labextension": "rimraf jlab_ext_example/labextension", "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jlab_ext_example/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "install-ext": "jupyter labextension install . --no-build", + "install:extension": "jupyter labextension develop --overwrite .", "prepare": "jlpm run clean && jlpm run build", - "watch": "tsc -w" + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/coreutils": "^4.0.0", - "@jupyterlab/launcher": "^2.0.0", - "@jupyterlab/services": "^5.0.0" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/coreutils": "~5.0.0-beta.3", + "@jupyterlab/launcher": "~3.0.0-beta.3", + "@jupyterlab/services": "~6.0.0-beta.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", "mkdirp": "^1.0.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" @@ -71,6 +76,7 @@ } } }, - "extension": true + "extension": true, + "outputDir": "jlab_ext_example/static" } -} +} \ No newline at end of file From 55ea69b410da5e31640c61d03538d842af08fe15 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 9 Sep 2020 17:01:51 -0500 Subject: [PATCH 3/8] Finish updating server extension --- .../jlab_ext_example/__init__.py | 16 +++++++++++++++- .../jlab_ext_example/handlers.py | 5 +++-- .../{static => public}/index.html | 0 .../jupyter-config/jlab_ext_example.json | 4 ++-- advanced/server-extension/pyproject.toml | 2 +- advanced/server-extension/setup.py | 17 ++++++++++------- advanced/server-extension/src/index.ts | 2 +- 7 files changed, 32 insertions(+), 14 deletions(-) rename advanced/server-extension/jlab_ext_example/{static => public}/index.html (100%) diff --git a/advanced/server-extension/jlab_ext_example/__init__.py b/advanced/server-extension/jlab_ext_example/__init__.py index a296f826..bee278f8 100644 --- a/advanced/server-extension/jlab_ext_example/__init__.py +++ b/advanced/server-extension/jlab_ext_example/__init__.py @@ -1,5 +1,19 @@ -from ._version import __version__ +import json +import os.path as osp + from .handlers import setup_handlers +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] def _jupyter_server_extension_paths(): diff --git a/advanced/server-extension/jlab_ext_example/handlers.py b/advanced/server-extension/jlab_ext_example/handlers.py index b245800e..11b72e0c 100644 --- a/advanced/server-extension/jlab_ext_example/handlers.py +++ b/advanced/server-extension/jlab_ext_example/handlers.py @@ -25,6 +25,7 @@ def post(self): def setup_handlers(web_app, url_path): + import pdb; pdb.set_trace() host_pattern = ".*$" base_url = web_app.settings["base_url"] @@ -34,10 +35,10 @@ def setup_handlers(web_app, url_path): web_app.add_handlers(host_pattern, handlers) # Prepend the base_url so that it works in a jupyterhub setting - doc_url = url_path_join(base_url, url_path, "static") + doc_url = url_path_join(base_url, url_path, "public") doc_dir = os.getenv( "JLAB_SERVER_EXAMPLE_STATIC_DIR", - os.path.join(os.path.dirname(__file__), "static"), + os.path.join(os.path.dirname(__file__), "public"), ) handlers = [("{}/(.*)".format(doc_url), StaticFileHandler, {"path": doc_dir})] web_app.add_handlers(".*$", handlers) diff --git a/advanced/server-extension/jlab_ext_example/static/index.html b/advanced/server-extension/jlab_ext_example/public/index.html similarity index 100% rename from advanced/server-extension/jlab_ext_example/static/index.html rename to advanced/server-extension/jlab_ext_example/public/index.html diff --git a/advanced/server-extension/jupyter-config/jlab_ext_example.json b/advanced/server-extension/jupyter-config/jlab_ext_example.json index 26b21bd8..03f6eef1 100644 --- a/advanced/server-extension/jupyter-config/jlab_ext_example.json +++ b/advanced/server-extension/jupyter-config/jlab_ext_example.json @@ -1,6 +1,6 @@ { - "NotebookApp": { - "nbserver_extensions": { + "ServerApp": { + "jpserver_extensions": { "jlab_ext_example": true } } diff --git a/advanced/server-extension/pyproject.toml b/advanced/server-extension/pyproject.toml index 010df900..873d43f4 100644 --- a/advanced/server-extension/pyproject.toml +++ b/advanced/server-extension/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.4.0", "jupyterlab~=2.0", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/advanced/server-extension/setup.py b/advanced/server-extension/setup.py index 7bdcd0cd..89ed6ca2 100644 --- a/advanced/server-extension/setup.py +++ b/advanced/server-extension/setup.py @@ -16,16 +16,17 @@ name="jlab_ext_example" # Ensure a valid python version -ensure_python(">=3.5") +ensure_python(">=3.6") # Get the version version = get_version(pjoin(name, "_version.py")) -lab_path = pjoin(HERE, name, "labextension") +lab_path = os.path.join(HERE, name, "static") # Representative files that should exist after a successful build jstargets = [ - pjoin(HERE, "lib", "jlabextexample.js"), + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), ] package_data_spec = { @@ -34,10 +35,12 @@ ] } +labext_name = "@jupyterlab-examples/server-extension" + data_files_spec = [ - ("share/jupyter/lab/extensions", lab_path, "*.tgz"), - ("etc/jupyter/jupyter_notebook_config.d", - "jupyter-config", "jlab_ext_example.json"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), + ("etc/jupyter/jupyter_server_config.d", + "jupyter-config", "jlab_ext_example.json"), ] cmdclass = create_cmdclass("jsdeps", @@ -64,7 +67,7 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=2.0", + "jupyterlab~=3.0.0b3", ], zip_safe=False, include_package_data=True, diff --git a/advanced/server-extension/src/index.ts b/advanced/server-extension/src/index.ts index 948d5752..2f68eaf7 100644 --- a/advanced/server-extension/src/index.ts +++ b/advanced/server-extension/src/index.ts @@ -86,7 +86,7 @@ class IFrameWidget extends IFrame { constructor() { super(); const baseUrl = PageConfig.getBaseUrl(); - this.url = baseUrl + 'jlab-ext-example/static/index.html'; + this.url = baseUrl + 'jlab-ext-example/public/index.html'; this.id = 'doc-example'; this.title.label = 'Server Doc'; this.title.closable = true; From 8099ef9603d1d31072e28d015164681142c686ab Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Wed, 9 Sep 2020 17:33:02 -0500 Subject: [PATCH 4/8] Update extensions and add update script Upgrade extensions for JupyterLab 3.0 debug pin nbconvert for now use nbconvert 5.6 fix uninstall method install jupyter-packaging Update server extension readme and use nbconvert 5.6 fix usages of serverextension commands Update readmes install latest pip remove nbconvert pin use verbose install try to force a true response in pip install switch to editable install try to force a true response in pip install debug print add more debug info use insensitive check Add upgrade script Remove unused jupyter-config files clean up script update server cleanup install --pre jupyterlab integrity --- .github/workflows/main.yml | 28 +++-- advanced/kernel-messaging/MANIFEST.in | 22 ++++ .../__init__.py | 19 +++ .../_version.py | 2 + advanced/kernel-messaging/package.json | 54 ++++---- advanced/kernel-messaging/pyproject.toml | 3 + advanced/kernel-messaging/setup.py | 87 +++++++++++++ advanced/kernel-output/MANIFEST.in | 22 ++++ .../__init__.py | 19 +++ .../_version.py | 2 + advanced/kernel-output/package.json | 52 +++++--- advanced/kernel-output/pyproject.toml | 3 + advanced/kernel-output/setup.py | 87 +++++++++++++ advanced/server-extension/README.md | 118 +++++++++--------- .../jlab_ext_example/handlers.py | 1 - advanced/server-extension/setup.py | 24 ++-- .../src/{jlabextexample.ts => handler.ts} | 0 advanced/server-extension/src/index.ts | 2 +- basics/datagrid/MANIFEST.in | 22 ++++ .../jupyterlab_examples_datagrid/__init__.py | 19 +++ .../jupyterlab_examples_datagrid/_version.py | 2 + basics/datagrid/package.json | 48 ++++--- basics/datagrid/pyproject.toml | 3 + basics/datagrid/setup.py | 87 +++++++++++++ basics/hello-world/MANIFEST.in | 22 ++++ basics/hello-world/README.md | 4 +- .../__init__.py | 19 +++ .../_version.py | 2 + basics/hello-world/package.json | 40 +++--- basics/hello-world/pyproject.toml | 3 + basics/hello-world/setup.py | 87 +++++++++++++ basics/signals/MANIFEST.in | 22 ++++ .../jupyterlab_examples_signals/__init__.py | 19 +++ .../jupyterlab_examples_signals/_version.py | 2 + basics/signals/package.json | 50 +++++--- basics/signals/pyproject.toml | 3 + basics/signals/setup.py | 87 +++++++++++++ command-palette/MANIFEST.in | 22 ++++ .../__init__.py | 19 +++ .../_version.py | 2 + command-palette/package.json | 40 +++--- command-palette/pyproject.toml | 3 + command-palette/setup.py | 87 +++++++++++++ commands/MANIFEST.in | 22 ++++ .../jupyterlab_examples_commands/__init__.py | 19 +++ .../jupyterlab_examples_commands/_version.py | 2 + commands/package.json | 40 +++--- commands/pyproject.toml | 3 + commands/setup.py | 87 +++++++++++++ context-menu/MANIFEST.in | 22 ++++ .../__init__.py | 19 +++ .../_version.py | 2 + context-menu/package.json | 46 ++++--- context-menu/pyproject.toml | 3 + context-menu/setup.py | 87 +++++++++++++ launcher/LICENSE | 30 ----- launcher/MANIFEST.in | 22 ++++ .../jupyterlab_examples_launcher/__init__.py | 19 +++ .../jupyterlab_examples_launcher/_version.py | 2 + launcher/package.json | 46 ++++--- launcher/pyproject.toml | 3 + launcher/setup.py | 87 +++++++++++++ log-console/custom-log-console/MANIFEST.in | 22 ++++ .../__init__.py | 19 +++ .../_version.py | 2 + log-console/custom-log-console/package.json | 58 +++++---- log-console/custom-log-console/pyproject.toml | 3 + log-console/custom-log-console/setup.py | 87 +++++++++++++ log-console/log-messages/MANIFEST.in | 22 ++++ .../__init__.py | 19 +++ .../_version.py | 2 + log-console/log-messages/package.json | 60 +++++---- log-console/log-messages/pyproject.toml | 3 + log-console/log-messages/setup.py | 87 +++++++++++++ main-menu/MANIFEST.in | 22 ++++ main-menu/README.md | 8 +- .../jupyterlab_examples_main_menu/__init__.py | 19 +++ .../jupyterlab_examples_main_menu/_version.py | 2 + main-menu/package.json | 44 ++++--- main-menu/pyproject.toml | 3 + main-menu/setup.py | 87 +++++++++++++ package.json | 5 +- react/react-widget/MANIFEST.in | 22 ++++ .../__init__.py | 19 +++ .../_version.py | 2 + react/react-widget/package.json | 43 ++++--- react/react-widget/pyproject.toml | 3 + react/react-widget/setup.py | 87 +++++++++++++ scripts/upgrade_extensions.py | 45 +++++++ settings/MANIFEST.in | 22 ++++ settings/README.md | 5 +- .../jupyterlab_examples_settings/__init__.py | 19 +++ .../jupyterlab_examples_settings/_version.py | 2 + settings/package.json | 46 ++++--- settings/pyproject.toml | 3 + settings/setup.py | 87 +++++++++++++ state/MANIFEST.in | 22 ++++ state/jupyterlab_examples_state/__init__.py | 19 +++ state/jupyterlab_examples_state/_version.py | 2 + state/package.json | 46 ++++--- state/pyproject.toml | 3 + state/setup.py | 87 +++++++++++++ widget-tracker/widgets/MANIFEST.in | 22 ++++ .../jupyterlab_examples_widgets/__init__.py | 19 +++ .../jupyterlab_examples_widgets/_version.py | 2 + widget-tracker/widgets/package.json | 48 ++++--- widget-tracker/widgets/pyproject.toml | 3 + widget-tracker/widgets/setup.py | 87 +++++++++++++ 108 files changed, 2750 insertions(+), 409 deletions(-) create mode 100644 advanced/kernel-messaging/MANIFEST.in create mode 100644 advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py create mode 100644 advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/_version.py create mode 100644 advanced/kernel-messaging/pyproject.toml create mode 100644 advanced/kernel-messaging/setup.py create mode 100644 advanced/kernel-output/MANIFEST.in create mode 100644 advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py create mode 100644 advanced/kernel-output/jupyterlab_examples_kernel_output/_version.py create mode 100644 advanced/kernel-output/pyproject.toml create mode 100644 advanced/kernel-output/setup.py rename advanced/server-extension/src/{jlabextexample.ts => handler.ts} (100%) create mode 100644 basics/datagrid/MANIFEST.in create mode 100644 basics/datagrid/jupyterlab_examples_datagrid/__init__.py create mode 100644 basics/datagrid/jupyterlab_examples_datagrid/_version.py create mode 100644 basics/datagrid/pyproject.toml create mode 100644 basics/datagrid/setup.py create mode 100644 basics/hello-world/MANIFEST.in create mode 100644 basics/hello-world/jupyterlab_examples_hello_world/__init__.py create mode 100644 basics/hello-world/jupyterlab_examples_hello_world/_version.py create mode 100644 basics/hello-world/pyproject.toml create mode 100644 basics/hello-world/setup.py create mode 100644 basics/signals/MANIFEST.in create mode 100644 basics/signals/jupyterlab_examples_signals/__init__.py create mode 100644 basics/signals/jupyterlab_examples_signals/_version.py create mode 100644 basics/signals/pyproject.toml create mode 100644 basics/signals/setup.py create mode 100644 command-palette/MANIFEST.in create mode 100644 command-palette/jupyterlab_examples_command_palette/__init__.py create mode 100644 command-palette/jupyterlab_examples_command_palette/_version.py create mode 100644 command-palette/pyproject.toml create mode 100644 command-palette/setup.py create mode 100644 commands/MANIFEST.in create mode 100644 commands/jupyterlab_examples_commands/__init__.py create mode 100644 commands/jupyterlab_examples_commands/_version.py create mode 100644 commands/pyproject.toml create mode 100644 commands/setup.py create mode 100644 context-menu/MANIFEST.in create mode 100644 context-menu/jupyterlab_examples_context_menu/__init__.py create mode 100644 context-menu/jupyterlab_examples_context_menu/_version.py create mode 100644 context-menu/pyproject.toml create mode 100644 context-menu/setup.py delete mode 100644 launcher/LICENSE create mode 100644 launcher/MANIFEST.in create mode 100644 launcher/jupyterlab_examples_launcher/__init__.py create mode 100644 launcher/jupyterlab_examples_launcher/_version.py create mode 100644 launcher/pyproject.toml create mode 100644 launcher/setup.py create mode 100644 log-console/custom-log-console/MANIFEST.in create mode 100644 log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py create mode 100644 log-console/custom-log-console/jupyterlab_examples_custom_log_console/_version.py create mode 100644 log-console/custom-log-console/pyproject.toml create mode 100644 log-console/custom-log-console/setup.py create mode 100644 log-console/log-messages/MANIFEST.in create mode 100644 log-console/log-messages/jupyterlab_examples_log_messages/__init__.py create mode 100644 log-console/log-messages/jupyterlab_examples_log_messages/_version.py create mode 100644 log-console/log-messages/pyproject.toml create mode 100644 log-console/log-messages/setup.py create mode 100644 main-menu/MANIFEST.in create mode 100644 main-menu/jupyterlab_examples_main_menu/__init__.py create mode 100644 main-menu/jupyterlab_examples_main_menu/_version.py create mode 100644 main-menu/pyproject.toml create mode 100644 main-menu/setup.py create mode 100644 react/react-widget/MANIFEST.in create mode 100644 react/react-widget/jupyterlab_examples_react_widget/__init__.py create mode 100644 react/react-widget/jupyterlab_examples_react_widget/_version.py create mode 100644 react/react-widget/pyproject.toml create mode 100644 react/react-widget/setup.py create mode 100644 scripts/upgrade_extensions.py create mode 100644 settings/MANIFEST.in create mode 100644 settings/jupyterlab_examples_settings/__init__.py create mode 100644 settings/jupyterlab_examples_settings/_version.py create mode 100644 settings/pyproject.toml create mode 100644 settings/setup.py create mode 100644 state/MANIFEST.in create mode 100644 state/jupyterlab_examples_state/__init__.py create mode 100644 state/jupyterlab_examples_state/_version.py create mode 100644 state/pyproject.toml create mode 100644 state/setup.py create mode 100644 widget-tracker/widgets/MANIFEST.in create mode 100644 widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py create mode 100644 widget-tracker/widgets/jupyterlab_examples_widgets/_version.py create mode 100644 widget-tracker/widgets/pyproject.toml create mode 100644 widget-tracker/widgets/setup.py diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5ebf30a3..974e696d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -73,7 +73,10 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - name: Install the Python dependencies - run: python -m pip install jupyterlab + run: | + python -m pip install --upgrade pip + python -m pip install jupyter_packaging + python -m pip install --pre jupyterlab - name: Install the NPM dependencies run: | cd ${EXAMPLE_FOLDER} @@ -91,9 +94,12 @@ jobs: - name: Build and check by extension run: | cd ${EXAMPLE_FOLDER} - jlpm run build - jupyter labextension install . + pip install -e . + jupyter labextension list 1>labextensions 2>&1 + cat labextensions + cat labextensions | grep -i "@jupyterlab-examples/*.*OK" python -m jupyterlab.browser_check + pip uninstall -y $(python setup.py --name) env: EXAMPLE_FOLDER: ${{ matrix.example }} shell: bash @@ -145,8 +151,9 @@ jobs: ${{ runner.os }}-pip- - name: Install the Python dependencies run: | + python -m pip install --upgrade pip python -m pip install jupyter_packaging - python -m pip install jupyterlab + python -m pip install --pre jupyterlab - name: Install the NPM dependencies run: | cd advanced/server-extension @@ -161,12 +168,11 @@ jobs: cd advanced/server-extension python setup.py sdist pip install jlab_ext_example --pre --find-links=dist --no-cache-dir - jupyter lab build python -m jupyterlab.browser_check - name: Check extension as dev if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') run: | - jupyter serverextension list 1>serverextensions 2>&1 + jupyter server extension list 1>serverextensions 2>&1 cat serverextensions | grep "jlab_ext_example.*OK" jupyter labextension list 1>labextensions 2>&1 cat labextensions | grep "@jupyterlab-examples/server-extension.*OK" @@ -174,18 +180,17 @@ jobs: run: | pip uninstall -y jlab_ext_example jupyter lab clean - jupyter serverextension list + jupyter server extension list jupyter labextension list - name: Build extension as dev run: | cd advanced/server-extension pip install -e . - jupyter serverextension enable --py jlab_ext_example - jupyter labextension install . + jupyter server extension enable --py jlab_ext_example - name: Check extension as dev if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS') run: | - jupyter serverextension list 1>serverextensions 2>&1 + jupyter server extension list 1>serverextensions 2>&1 cat serverextensions | grep "jlab_ext_example.*OK" jupyter labextension list 1>labextensions 2>&1 cat labextensions | grep "@jupyterlab-examples/server-extension.*OK" @@ -231,7 +236,7 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - name: Install the Python dependencies - run: python -m pip install jupyterlab + run: python -m pip install --pre jupyterlab - name: Bootstrap the jlpm deps run: jlpm - name: Build all the extensions @@ -239,4 +244,3 @@ jobs: jlpm build-ext jlpm lint:check jlpm install-ext - jlpm build-jlab diff --git a/advanced/kernel-messaging/MANIFEST.in b/advanced/kernel-messaging/MANIFEST.in new file mode 100644 index 00000000..a192a4cc --- /dev/null +++ b/advanced/kernel-messaging/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_kernel_messaging.json + +include package.json +include ts*.json + +graft jupyterlab_examples_kernel_messaging/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py b/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/_version.py b/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/advanced/kernel-messaging/jupyterlab_examples_kernel_messaging/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/advanced/kernel-messaging/package.json b/advanced/kernel-messaging/package.json index 0ba26072..d4b535cf 100644 --- a/advanced/kernel-messaging/package.json +++ b/advanced/kernel-messaging/package.json @@ -25,40 +25,52 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_kernel_messaging/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/launcher": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@jupyterlab/nbformat": "^2.0.0", - "@lumino/algorithm": "^1.2.3", - "@lumino/coreutils": "^1.3.1", + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/launcher": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/nbformat": "~3.0.0-beta.3", + "@lumino/algorithm": "^1.3.3", + "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.5.2", - "@lumino/disposable": "^1.3.1", - "@lumino/widgets": "^1.11.0" + "@lumino/disposable": "^1.4.3", + "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_kernel_messaging/static" } -} +} \ No newline at end of file diff --git a/advanced/kernel-messaging/pyproject.toml b/advanced/kernel-messaging/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/advanced/kernel-messaging/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/advanced/kernel-messaging/setup.py b/advanced/kernel-messaging/setup.py new file mode 100644 index 00000000..f6b64820 --- /dev/null +++ b/advanced/kernel-messaging/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_kernel_messaging setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_kernel_messaging" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/kernel-messaging" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="minimal lab example", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/advanced/kernel-output/MANIFEST.in b/advanced/kernel-output/MANIFEST.in new file mode 100644 index 00000000..fbb66f9d --- /dev/null +++ b/advanced/kernel-output/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_kernel_output.json + +include package.json +include ts*.json + +graft jupyterlab_examples_kernel_output/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py b/advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/advanced/kernel-output/jupyterlab_examples_kernel_output/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/advanced/kernel-output/jupyterlab_examples_kernel_output/_version.py b/advanced/kernel-output/jupyterlab_examples_kernel_output/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/advanced/kernel-output/jupyterlab_examples_kernel_output/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/advanced/kernel-output/package.json b/advanced/kernel-output/package.json index 1c85e901..40cd3867 100644 --- a/advanced/kernel-output/package.json +++ b/advanced/kernel-output/package.json @@ -25,39 +25,51 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_kernel_output/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/launcher": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@jupyterlab/outputarea": "^2.0.0", - "@lumino/algorithm": "^1.1.2", - "@lumino/coreutils": "^1.3.0", + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/launcher": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/outputarea": "~3.0.0-beta.3", + "@lumino/algorithm": "^1.3.3", + "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.3.1", - "@lumino/disposable": "^1.1.2" + "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_kernel_output/static" } -} +} \ No newline at end of file diff --git a/advanced/kernel-output/pyproject.toml b/advanced/kernel-output/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/advanced/kernel-output/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/advanced/kernel-output/setup.py b/advanced/kernel-output/setup.py new file mode 100644 index 00000000..c2341904 --- /dev/null +++ b/advanced/kernel-output/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_kernel_output setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_kernel_output" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/kernel-output" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="minimal lab example", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/advanced/server-extension/README.md b/advanced/server-extension/README.md index 005450e3..a046dfd2 100644 --- a/advanced/server-extension/README.md +++ b/advanced/server-extension/README.md @@ -89,12 +89,12 @@ to demonstrate the use of GET and POST HTTP requests. The entry point for the frontend extension is `src/index.ts`. The communication with the server extension is contained in another file -`src/jlabextexample.ts`. So you need to import it: +`src/handler.ts`. So you need to import it: ```ts // src/index.ts#L12-L12 -import { requestAPI } from './jlabextexample'; +import { requestAPI } from './handler'; ``` In the `activate` function, the server extension is first called through @@ -167,7 +167,7 @@ The communication logic with the server is hidden in the `requestAPI` function. Its definition is : ```ts -// src/jlabextexample.ts#L12-L37 +// src/handler.ts#L12-L37 export async function requestAPI( endPoint = '', @@ -200,7 +200,7 @@ export async function requestAPI( First the server settings are obtained from: ```ts -// src/jlabextexample.ts#L17-L17 +// src/handler.ts#L17-L17 const settings = ServerConnection.makeSettings(); ``` @@ -214,7 +214,7 @@ jlpm add @jupyterlab/services Then the class `ServerConnection` can be imported: ```ts -// src/jlabextexample.ts#L3-L3 +// src/handler.ts#L3-L3 import { ServerConnection } from '@jupyterlab/services'; ``` @@ -222,7 +222,7 @@ import { ServerConnection } from '@jupyterlab/services'; The next step is to build the full request URL: ```ts -// src/jlabextexample.ts#L18-L21 +// src/handler.ts#L18-L21 const requestUrl = URLExt.join( settings.baseUrl, @@ -233,7 +233,7 @@ const requestUrl = URLExt.join( To concatenate the various parts, the `URLExt` utility is imported: ```ts -// src/jlabextexample.ts#L1-L1 +// src/handler.ts#L1-L1 import { URLExt } from '@jupyterlab/coreutils'; ``` @@ -247,7 +247,7 @@ jlpm add @jupyterlab/coreutils You now have all the elements to make the request: ```ts -// src/jlabextexample.ts#L26-L26 +// src/handler.ts#L26-L26 response = await ServerConnection.makeRequest(requestUrl, init, settings); ``` @@ -256,7 +256,7 @@ Finally, once the server response is obtained, its body is interpreted as JSON. And the resulting data is returned. ```ts -// src/jlabextexample.ts#L31-L37 +// src/handler.ts#L31-L37 const data = await response.json(); @@ -332,8 +332,22 @@ your extension needs to be defined as a proper Python package with some hook fun ```py # jlab_ext_example/__init__.py -from ._version import __version__ +import json +import os.path as osp + from .handlers import setup_handlers +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] def _jupyter_server_extension_paths(): @@ -353,6 +367,7 @@ def load_jupyter_server_extension(lab_app): "Registered jlab_ext_example extension at URL path /{}".format(url_path) ) + ``` The `_jupyter_jlab_ext_example_paths` provides the Python package name @@ -360,7 +375,7 @@ to the server. But the most important one is `load_jupyter_jlab_ext_example` that register new handlers. ```py -# jlab_ext_example/__init__.py#L17-L17 +# jlab_ext_example/__init__.py#L31-L31 setup_handlers(lab_app.web_app, url_path) ``` @@ -441,10 +456,10 @@ is the following: ```py # jlab_ext_example/handlers.py#L37-L43 -doc_url = url_path_join(base_url, url_path, "static") +doc_url = url_path_join(base_url, url_path, "public") doc_dir = os.getenv( "JLAB_SERVER_EXAMPLE_STATIC_DIR", - os.path.join(os.path.dirname(__file__), "static"), + os.path.join(os.path.dirname(__file__), "public"), ) handlers = [("{}/(.*)".format(doc_url), StaticFileHandler, {"path": doc_dir})] web_app.add_handlers(".*$", handlers) @@ -480,14 +495,13 @@ The `setup.py` file is the entry point to describe package metadata: # setup.py """ -Setup Module to setup Python Handlers for the jlab_ext_example extension. +jlab_ext_example setup """ import os -from os.path import join as pjoin from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version + combine_commands, ensure_python, get_version, ) import setuptools @@ -497,16 +511,17 @@ HERE = os.path.abspath(os.path.dirname(__file__)) name="jlab_ext_example" # Ensure a valid python version -ensure_python(">=3.5") +ensure_python(">=3.6") -# Get the version -version = get_version(pjoin(name, "_version.py")) +# Get our version +version = get_version(os.path.join(name, "_version.py")) -lab_path = pjoin(HERE, name, "labextension") +lab_path = os.path.join(HERE, name, "static") # Representative files that should exist after a successful build jstargets = [ - pjoin(HERE, "lib", "jlabextexample.js"), + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), ] package_data_spec = { @@ -515,13 +530,15 @@ package_data_spec = { ] } +labext_name = "@jupyterlab-examples/server-extension" + data_files_spec = [ - ("share/jupyter/lab/extensions", lab_path, "*.tgz"), - ("etc/jupyter/jupyter_notebook_config.d", + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"),("etc/jupyter/jupyter_server_config.d", "jupyter-config", "jlab_ext_example.json"), + ] -cmdclass = create_cmdclass("jsdeps", +cmdclass = create_cmdclass("jsdeps", package_data_spec=package_data_spec, data_files_spec=data_files_spec ) @@ -537,15 +554,15 @@ with open("README.md", "r") as fh: setup_args = dict( name=name, version=version, - url="https://github.com/jupyterlab/extension-examples", - author="JupyterLab", + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", description="A minimal JupyterLab extension with backend and frontend parts.", long_description= long_description, long_description_content_type="text/markdown", cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=2.0", + "jupyterlab~=3.0.0b3", ], zip_safe=False, include_package_data=True, @@ -556,7 +573,6 @@ setup_args = dict( "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", @@ -565,9 +581,10 @@ setup_args = dict( ) -if __name__ == '__main__': +if __name__ == "__main__": setuptools.setup(**setup_args) + ``` But in this case, it is a bit more complicated to build the frontend extension and ship it @@ -576,9 +593,9 @@ the frontend NPM package needs to be built and inserted in the Python package. T done using a special `cmdclass`: ```py -# setup.py#L43-L51 +# setup.py#L45-L53 -cmdclass = create_cmdclass("jsdeps", +cmdclass = create_cmdclass("jsdeps", package_data_spec=package_data_spec, data_files_spec=data_files_spec ) @@ -592,7 +609,7 @@ cmdclass["jsdeps"] = combine_commands( Basically it will build the frontend NPM package: ```py -# setup.py#L49-L49 +# setup.py#L51-L51 install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), ``` @@ -600,10 +617,11 @@ install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), It will ensure one of the generated JS files is `lib/jlabextexample.js`: ```py -# setup.py#L27-L29 +# setup.py#L26-L29 jstargets = [ - pjoin(HERE, "lib", "jlabextexample.js"), + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), ] ``` @@ -611,9 +629,8 @@ It will copy the NPM package in the Python package and force it to be copied in JupyterLab is looking for frontend extensions when the Python package is installed: ```py -# setup.py#L38-L38 -("share/jupyter/lab/extensions", lab_path, "*.tgz"), +("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*") ``` The last piece of configuration needed is the enabling of the server extension. This is @@ -623,8 +640,8 @@ done by copying the following JSON file: // jupyter-config/jlab_ext_example.json { - "NotebookApp": { - "nbserver_extensions": { + "ServerApp": { + "jpserver_extensions": { "jlab_ext_example": true } } @@ -632,13 +649,12 @@ done by copying the following JSON file: ``` -in the appropriate jupyter folder (`etc/jupyter/jupyter_notebook_config.d`): +in the appropriate jupyter folder (`etc/jupyter/jupyter_server_config.d`): ```py -# setup.py#L39-L40 -("etc/jupyter/jupyter_notebook_config.d", - "jupyter-config", "jlab_ext_example.json"), + ("etc/jupyter/jupyter_server_config.d", + "jupyter-config", "jlab_ext_example.json"), ``` ### JupyterLab Extension Manager @@ -650,7 +666,7 @@ user about that dependency by adding the `discovery` metadata to your `package.j file: ```json5 -// package.json#L63-L73 +// package.json#L68-L78 "jupyterlab": { "discovery": { @@ -668,7 +684,7 @@ file: In this example, the extension requires a `server` extension: ```json5 -// package.json#L65-L65 +// package.json#L70-L70 "server": { ``` @@ -676,7 +692,7 @@ In this example, the extension requires a `server` extension: And that server extension is available through `pip`: ```json5 -// package.json#L66-L68 +// package.json#L71-L73 "managers": [ "pip" @@ -693,12 +709,8 @@ With the packaging described above, installing the extension is done in two comm # Install the server extension and # copy the frontend extension where JupyterLab can find it pip install jlab_ext_example -# Build JupyterLab to integrate the frontend extension -jupyter lab build ``` -> Note: User will need NodeJS to install the extension. - As developer, you might want to install the package in local editable mode. This will shunt the installation machinery described above. Therefore the commands to get you set are: @@ -706,18 +718,12 @@ to get you set are: ```bash # Install server extension in editable mode pip install -e . -# Register server extension -jupyter serverextension enable --py jlab_ext_example -# Install dependencies -jlpm # Build Typescript source jlpm build # Install your development version of the extension with JupyterLab -jupyter labextension install . +jupyter labextension develop . # Rebuild Typescript source after making changes jlpm build -# Rebuild JupyterLab after making any changes -jupyter lab build ``` diff --git a/advanced/server-extension/jlab_ext_example/handlers.py b/advanced/server-extension/jlab_ext_example/handlers.py index 11b72e0c..7effc12b 100644 --- a/advanced/server-extension/jlab_ext_example/handlers.py +++ b/advanced/server-extension/jlab_ext_example/handlers.py @@ -25,7 +25,6 @@ def post(self): def setup_handlers(web_app, url_path): - import pdb; pdb.set_trace() host_pattern = ".*$" base_url = web_app.settings["base_url"] diff --git a/advanced/server-extension/setup.py b/advanced/server-extension/setup.py index 89ed6ca2..9631d2da 100644 --- a/advanced/server-extension/setup.py +++ b/advanced/server-extension/setup.py @@ -1,12 +1,11 @@ """ -Setup Module to setup Python Handlers for the jlab_ext_example extension. +jlab_ext_example setup """ import os -from os.path import join as pjoin from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version + combine_commands, ensure_python, get_version, ) import setuptools @@ -18,8 +17,8 @@ # Ensure a valid python version ensure_python(">=3.6") -# Get the version -version = get_version(pjoin(name, "_version.py")) +# Get our version +version = get_version(os.path.join(name, "_version.py")) lab_path = os.path.join(HERE, name, "static") @@ -38,12 +37,12 @@ labext_name = "@jupyterlab-examples/server-extension" data_files_spec = [ - ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), - ("etc/jupyter/jupyter_server_config.d", - "jupyter-config", "jlab_ext_example.json"), + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"),("etc/jupyter/jupyter_server_config.d", + "jupyter-config", "jlab_ext_example.json"), + ] -cmdclass = create_cmdclass("jsdeps", +cmdclass = create_cmdclass("jsdeps", package_data_spec=package_data_spec, data_files_spec=data_files_spec ) @@ -59,8 +58,8 @@ setup_args = dict( name=name, version=version, - url="https://github.com/jupyterlab/extension-examples", - author="JupyterLab", + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", description="A minimal JupyterLab extension with backend and frontend parts.", long_description= long_description, long_description_content_type="text/markdown", @@ -78,7 +77,6 @@ "License :: OSI Approved :: BSD License", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", @@ -87,5 +85,5 @@ ) -if __name__ == '__main__': +if __name__ == "__main__": setuptools.setup(**setup_args) diff --git a/advanced/server-extension/src/jlabextexample.ts b/advanced/server-extension/src/handler.ts similarity index 100% rename from advanced/server-extension/src/jlabextexample.ts rename to advanced/server-extension/src/handler.ts diff --git a/advanced/server-extension/src/index.ts b/advanced/server-extension/src/index.ts index 2f68eaf7..5883e09d 100644 --- a/advanced/server-extension/src/index.ts +++ b/advanced/server-extension/src/index.ts @@ -9,7 +9,7 @@ import { PageConfig } from '@jupyterlab/coreutils'; import { ILauncher } from '@jupyterlab/launcher'; -import { requestAPI } from './jlabextexample'; +import { requestAPI } from './handler'; /** * The command IDs used by the server extension plugin. diff --git a/basics/datagrid/MANIFEST.in b/basics/datagrid/MANIFEST.in new file mode 100644 index 00000000..ef85b8ba --- /dev/null +++ b/basics/datagrid/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_datagrid.json + +include package.json +include ts*.json + +graft jupyterlab_examples_datagrid/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/basics/datagrid/jupyterlab_examples_datagrid/__init__.py b/basics/datagrid/jupyterlab_examples_datagrid/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/basics/datagrid/jupyterlab_examples_datagrid/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/basics/datagrid/jupyterlab_examples_datagrid/_version.py b/basics/datagrid/jupyterlab_examples_datagrid/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/basics/datagrid/jupyterlab_examples_datagrid/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/basics/datagrid/package.json b/basics/datagrid/package.json index dfe1036e..ce2738f5 100644 --- a/basics/datagrid/package.json +++ b/basics/datagrid/package.json @@ -25,37 +25,49 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_datagrid/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@lumino/algorithm": "^1.2.3", - "@lumino/coreutils": "^1.3.1", + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@lumino/algorithm": "^1.3.3", + "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.5.2", - "@lumino/disposable": "^1.3.1" + "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_datagrid/static" } -} +} \ No newline at end of file diff --git a/basics/datagrid/pyproject.toml b/basics/datagrid/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/basics/datagrid/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/basics/datagrid/setup.py b/basics/datagrid/setup.py new file mode 100644 index 00000000..54b85be6 --- /dev/null +++ b/basics/datagrid/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_datagrid setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_datagrid" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/datagrid" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="minimal lab example", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/basics/hello-world/MANIFEST.in b/basics/hello-world/MANIFEST.in new file mode 100644 index 00000000..a766c6f4 --- /dev/null +++ b/basics/hello-world/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_hello_world.json + +include package.json +include ts*.json + +graft jupyterlab_examples_hello_world/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/basics/hello-world/README.md b/basics/hello-world/README.md index 5d4e5745..4ea18e27 100644 --- a/basics/hello-world/README.md +++ b/basics/hello-world/README.md @@ -91,10 +91,10 @@ called `@jupyterlab/application`. The dependency of your extension on this package is declared in the file `package.json`: ```json5 -// package.json#L36-L38 +// package.json#L44-L46 "dependencies": { - "@jupyterlab/application": "^2.0.0" + "@jupyterlab/application": "~3.0.0-beta.3" }, ``` diff --git a/basics/hello-world/jupyterlab_examples_hello_world/__init__.py b/basics/hello-world/jupyterlab_examples_hello_world/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/basics/hello-world/jupyterlab_examples_hello_world/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/basics/hello-world/jupyterlab_examples_hello_world/_version.py b/basics/hello-world/jupyterlab_examples_hello_world/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/basics/hello-world/jupyterlab_examples_hello_world/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/basics/hello-world/package.json b/basics/hello-world/package.json index 5124b0ac..8e796d21 100644 --- a/basics/hello-world/package.json +++ b/basics/hello-world/package.json @@ -25,32 +25,44 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_hello_world/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0" + "@jupyterlab/application": "~3.0.0-beta.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_hello_world/static" } -} +} \ No newline at end of file diff --git a/basics/hello-world/pyproject.toml b/basics/hello-world/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/basics/hello-world/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/basics/hello-world/setup.py b/basics/hello-world/setup.py new file mode 100644 index 00000000..56c37399 --- /dev/null +++ b/basics/hello-world/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_hello_world setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_hello_world" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/hello-world" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="minimal lab example", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/basics/signals/MANIFEST.in b/basics/signals/MANIFEST.in new file mode 100644 index 00000000..01de20c5 --- /dev/null +++ b/basics/signals/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_signals.json + +include package.json +include ts*.json + +graft jupyterlab_examples_signals/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/basics/signals/jupyterlab_examples_signals/__init__.py b/basics/signals/jupyterlab_examples_signals/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/basics/signals/jupyterlab_examples_signals/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/basics/signals/jupyterlab_examples_signals/_version.py b/basics/signals/jupyterlab_examples_signals/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/basics/signals/jupyterlab_examples_signals/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/basics/signals/package.json b/basics/signals/package.json index 70a46700..16c25b3f 100644 --- a/basics/signals/package.json +++ b/basics/signals/package.json @@ -25,38 +25,50 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_signals/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/launcher": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@lumino/algorithm": "^1.2.0", - "@lumino/coreutils": "^1.3.1", + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/launcher": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@lumino/algorithm": "^1.3.3", + "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.3.1", - "@lumino/disposable": "^1.3.1" + "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_signals/static" } -} +} \ No newline at end of file diff --git a/basics/signals/pyproject.toml b/basics/signals/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/basics/signals/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/basics/signals/setup.py b/basics/signals/setup.py new file mode 100644 index 00000000..fe5de71d --- /dev/null +++ b/basics/signals/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_signals setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_signals" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/signals" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="minimal lab example", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/command-palette/MANIFEST.in b/command-palette/MANIFEST.in new file mode 100644 index 00000000..cabb5aa7 --- /dev/null +++ b/command-palette/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_command_palette.json + +include package.json +include ts*.json + +graft jupyterlab_examples_command_palette/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/command-palette/jupyterlab_examples_command_palette/__init__.py b/command-palette/jupyterlab_examples_command_palette/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/command-palette/jupyterlab_examples_command_palette/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/command-palette/jupyterlab_examples_command_palette/_version.py b/command-palette/jupyterlab_examples_command_palette/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/command-palette/jupyterlab_examples_command_palette/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/command-palette/package.json b/command-palette/package.json index 9c534f57..6fd52106 100644 --- a/command-palette/package.json +++ b/command-palette/package.json @@ -25,32 +25,44 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_command_palette/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0" + "@jupyterlab/application": "~3.0.0-beta.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_command_palette/static" } -} +} \ No newline at end of file diff --git a/command-palette/pyproject.toml b/command-palette/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/command-palette/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/command-palette/setup.py b/command-palette/setup.py new file mode 100644 index 00000000..0d7a3d1a --- /dev/null +++ b/command-palette/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_command_palette setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_command_palette" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/command-palette" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="Minimal JupyterLab example adding a new command to the palette.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/commands/MANIFEST.in b/commands/MANIFEST.in new file mode 100644 index 00000000..c27952a3 --- /dev/null +++ b/commands/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_commands.json + +include package.json +include ts*.json + +graft jupyterlab_examples_commands/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/commands/jupyterlab_examples_commands/__init__.py b/commands/jupyterlab_examples_commands/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/commands/jupyterlab_examples_commands/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/commands/jupyterlab_examples_commands/_version.py b/commands/jupyterlab_examples_commands/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/commands/jupyterlab_examples_commands/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/commands/package.json b/commands/package.json index 3cdbe104..05157984 100644 --- a/commands/package.json +++ b/commands/package.json @@ -25,32 +25,44 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_commands/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0" + "@jupyterlab/application": "~3.0.0-beta.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_commands/static" } -} +} \ No newline at end of file diff --git a/commands/pyproject.toml b/commands/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/commands/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/commands/setup.py b/commands/setup.py new file mode 100644 index 00000000..0f4eab13 --- /dev/null +++ b/commands/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_commands setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_commands" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/commands" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="Minimal JupyterLab example creating a new command.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/context-menu/MANIFEST.in b/context-menu/MANIFEST.in new file mode 100644 index 00000000..64369514 --- /dev/null +++ b/context-menu/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_context_menu.json + +include package.json +include ts*.json + +graft jupyterlab_examples_context_menu/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/context-menu/jupyterlab_examples_context_menu/__init__.py b/context-menu/jupyterlab_examples_context_menu/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/context-menu/jupyterlab_examples_context_menu/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/context-menu/jupyterlab_examples_context_menu/_version.py b/context-menu/jupyterlab_examples_context_menu/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/context-menu/jupyterlab_examples_context_menu/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/context-menu/package.json b/context-menu/package.json index 0dffb243..ae7c9b0e 100644 --- a/context-menu/package.json +++ b/context-menu/package.json @@ -25,35 +25,47 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_context_menu/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.1.2", - "@jupyterlab/apputils": "^2.1.1", - "@jupyterlab/filebrowser": "^2.1.2", - "@jupyterlab/ui-components": "^2.1.1" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/apputils": "~3.0.0-beta.3", + "@jupyterlab/filebrowser": "~3.0.0-beta.3", + "@jupyterlab/ui-components": "~3.0.0-beta.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_context_menu/static" } -} +} \ No newline at end of file diff --git a/context-menu/pyproject.toml b/context-menu/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/context-menu/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/context-menu/setup.py b/context-menu/setup.py new file mode 100644 index 00000000..f6f9ec16 --- /dev/null +++ b/context-menu/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_context_menu setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_context_menu" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/context-menu" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="A minimal JupyterLab example to develop a context-menu.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/launcher/LICENSE b/launcher/LICENSE deleted file mode 100644 index 2649ea39..00000000 --- a/launcher/LICENSE +++ /dev/null @@ -1,30 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2019, Jeremy Tuloup -Copyright (c) 2019, Jupyter Development Team -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -3. Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. \ No newline at end of file diff --git a/launcher/MANIFEST.in b/launcher/MANIFEST.in new file mode 100644 index 00000000..f95674be --- /dev/null +++ b/launcher/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_launcher.json + +include package.json +include ts*.json + +graft jupyterlab_examples_launcher/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/launcher/jupyterlab_examples_launcher/__init__.py b/launcher/jupyterlab_examples_launcher/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/launcher/jupyterlab_examples_launcher/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/launcher/jupyterlab_examples_launcher/_version.py b/launcher/jupyterlab_examples_launcher/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/launcher/jupyterlab_examples_launcher/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/launcher/package.json b/launcher/package.json index 2ffb3ffb..7250966c 100644 --- a/launcher/package.json +++ b/launcher/package.json @@ -25,36 +25,48 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_launcher/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/filebrowser": "^2.0.0", - "@jupyterlab/launcher": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/filebrowser": "~3.0.0-beta.3", + "@jupyterlab/launcher": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css", "style/*.svg" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_launcher/static" } -} +} \ No newline at end of file diff --git a/launcher/pyproject.toml b/launcher/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/launcher/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/launcher/setup.py b/launcher/setup.py new file mode 100644 index 00000000..108459fc --- /dev/null +++ b/launcher/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_launcher setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_launcher" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/launcher" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="A minimal JupyterLab example using the launcher.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/log-console/custom-log-console/MANIFEST.in b/log-console/custom-log-console/MANIFEST.in new file mode 100644 index 00000000..2f4f46ff --- /dev/null +++ b/log-console/custom-log-console/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_custom_log_console.json + +include package.json +include ts*.json + +graft jupyterlab_examples_custom_log_console/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py b/log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/log-console/custom-log-console/jupyterlab_examples_custom_log_console/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/log-console/custom-log-console/jupyterlab_examples_custom_log_console/_version.py b/log-console/custom-log-console/jupyterlab_examples_custom_log_console/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/log-console/custom-log-console/jupyterlab_examples_custom_log_console/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/log-console/custom-log-console/package.json b/log-console/custom-log-console/package.json index a16a0a49..8be681cf 100644 --- a/log-console/custom-log-console/package.json +++ b/log-console/custom-log-console/package.json @@ -25,41 +25,53 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_custom_log_console/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.1.2", - "@jupyterlab/apputils": "^2.1.1", - "@jupyterlab/coreutils": "^4.1.0", - "@jupyterlab/logconsole": "^2.1.1", - "@jupyterlab/mainmenu": "^2.1.1", - "@jupyterlab/nbformat": "^2.1.0", - "@jupyterlab/rendermime": "^2.1.1", - "@jupyterlab/ui-components": "^2.1.1", - "@lumino/coreutils": "^1.5.0", - "@lumino/widgets": "^1.13.0" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/apputils": "~3.0.0-beta.3", + "@jupyterlab/coreutils": "~5.0.0-beta.3", + "@jupyterlab/logconsole": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/nbformat": "~3.0.0-beta.3", + "@jupyterlab/rendermime": "~3.0.0-beta.3", + "@jupyterlab/ui-components": "~3.0.0-beta.3", + "@lumino/coreutils": "^1.5.3", + "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_custom_log_console/static" } -} +} \ No newline at end of file diff --git a/log-console/custom-log-console/pyproject.toml b/log-console/custom-log-console/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/log-console/custom-log-console/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/log-console/custom-log-console/setup.py b/log-console/custom-log-console/setup.py new file mode 100644 index 00000000..327f52ae --- /dev/null +++ b/log-console/custom-log-console/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_custom_log_console setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_custom_log_console" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/custom-log-console" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="A minimal JupyterLab example to develop a custom log console.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/log-console/log-messages/MANIFEST.in b/log-console/log-messages/MANIFEST.in new file mode 100644 index 00000000..d3382d09 --- /dev/null +++ b/log-console/log-messages/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_log_messages.json + +include package.json +include ts*.json + +graft jupyterlab_examples_log_messages/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/log-console/log-messages/jupyterlab_examples_log_messages/__init__.py b/log-console/log-messages/jupyterlab_examples_log_messages/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/log-console/log-messages/jupyterlab_examples_log_messages/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/log-console/log-messages/jupyterlab_examples_log_messages/_version.py b/log-console/log-messages/jupyterlab_examples_log_messages/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/log-console/log-messages/jupyterlab_examples_log_messages/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/log-console/log-messages/package.json b/log-console/log-messages/package.json index 9127dc0d..d7f47e22 100644 --- a/log-console/log-messages/package.json +++ b/log-console/log-messages/package.json @@ -25,42 +25,54 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_log_messages/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.1.2", - "@jupyterlab/apputils": "^2.1.1", - "@jupyterlab/coreutils": "^4.1.0", - "@jupyterlab/logconsole": "^2.1.1", - "@jupyterlab/mainmenu": "^2.1.1", - "@jupyterlab/nbformat": "^2.1.0", - "@jupyterlab/notebook": "^2.1.2", - "@jupyterlab/rendermime": "^2.1.1", - "@jupyterlab/ui-components": "^2.1.1", - "@lumino/coreutils": "^1.5.0", - "@lumino/widgets": "^1.13.0" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/apputils": "~3.0.0-beta.3", + "@jupyterlab/coreutils": "~5.0.0-beta.3", + "@jupyterlab/logconsole": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/nbformat": "~3.0.0-beta.3", + "@jupyterlab/notebook": "~3.0.0-beta.3", + "@jupyterlab/rendermime": "~3.0.0-beta.3", + "@jupyterlab/ui-components": "~3.0.0-beta.3", + "@lumino/coreutils": "^1.5.3", + "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_log_messages/static" } -} +} \ No newline at end of file diff --git a/log-console/log-messages/pyproject.toml b/log-console/log-messages/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/log-console/log-messages/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/log-console/log-messages/setup.py b/log-console/log-messages/setup.py new file mode 100644 index 00000000..4efff72f --- /dev/null +++ b/log-console/log-messages/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_log_messages setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_log_messages" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/log-messages" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="A minimal JupyterLab example to develop a custom log-messages.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/main-menu/MANIFEST.in b/main-menu/MANIFEST.in new file mode 100644 index 00000000..31c840a3 --- /dev/null +++ b/main-menu/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_main_menu.json + +include package.json +include ts*.json + +graft jupyterlab_examples_main_menu/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/main-menu/README.md b/main-menu/README.md index 1fdb7b84..d3fda127 100644 --- a/main-menu/README.md +++ b/main-menu/README.md @@ -85,12 +85,12 @@ After the execution of that command, `package.json` should list them in the `dependencies`: ```json5 -// package.json#L36-L40 +// package.json#L44-L48 "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@lumino/widgets": "^1.9.3" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@lumino/widgets": "^1.14.0" }, ``` diff --git a/main-menu/jupyterlab_examples_main_menu/__init__.py b/main-menu/jupyterlab_examples_main_menu/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/main-menu/jupyterlab_examples_main_menu/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/main-menu/jupyterlab_examples_main_menu/_version.py b/main-menu/jupyterlab_examples_main_menu/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/main-menu/jupyterlab_examples_main_menu/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/main-menu/package.json b/main-menu/package.json index c84d7fca..48aa1810 100644 --- a/main-menu/package.json +++ b/main-menu/package.json @@ -25,34 +25,46 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_main_menu/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@lumino/widgets": "^1.9.3" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_main_menu/static" } -} +} \ No newline at end of file diff --git a/main-menu/pyproject.toml b/main-menu/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/main-menu/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/main-menu/setup.py b/main-menu/setup.py new file mode 100644 index 00000000..3a043ed3 --- /dev/null +++ b/main-menu/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_main_menu setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_main_menu" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/main-menu" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="Minimal JupyterLab example adding a menu.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/package.json b/package.json index d4e6e7c2..bdcd8203 100644 --- a/package.json +++ b/package.json @@ -4,11 +4,10 @@ "scripts": { "bootstrap": "lerna bootstrap", "install": "lerna bootstrap", - "build-jlab": "jupyter lab build --debug", - "build-ext": "lerna run build", + "build-ext": "lerna run build:all", "clean-ext": "lerna run clean", "embedme": "embedme \"[!n]*/**/README.md\"", - "install-ext": "lerna run install-ext", + "install-ext": "lerna run install:extension", "lint": "jlpm && jlpm run prettier", "lint:check": "jlpm run embedme --verify && jlpm run prettier:check", "prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"", diff --git a/react/react-widget/MANIFEST.in b/react/react-widget/MANIFEST.in new file mode 100644 index 00000000..558067e8 --- /dev/null +++ b/react/react-widget/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_react_widget.json + +include package.json +include ts*.json + +graft jupyterlab_examples_react_widget/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/react/react-widget/jupyterlab_examples_react_widget/__init__.py b/react/react-widget/jupyterlab_examples_react_widget/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/react/react-widget/jupyterlab_examples_react_widget/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/react/react-widget/jupyterlab_examples_react_widget/_version.py b/react/react-widget/jupyterlab_examples_react_widget/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/react/react-widget/jupyterlab_examples_react_widget/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/react/react-widget/package.json b/react/react-widget/package.json index 9350e99d..a6ccbf96 100644 --- a/react/react-widget/package.json +++ b/react/react-widget/package.json @@ -25,33 +25,46 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib && rimraf tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_react_widget/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/launcher": "^2.0.0", - "@jupyterlab/ui-components": "^2.0.0" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/launcher": "~3.0.0-beta.3", + "@jupyterlab/ui-components": "~3.0.0-beta.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_react_widget/static" } -} +} \ No newline at end of file diff --git a/react/react-widget/pyproject.toml b/react/react-widget/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/react/react-widget/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/react/react-widget/setup.py b/react/react-widget/setup.py new file mode 100644 index 00000000..03c61ead --- /dev/null +++ b/react/react-widget/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_react_widget setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_react_widget" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/react-widget" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="Example of using a React Widget in a Jupyterlab extension", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/scripts/upgrade_extensions.py b/scripts/upgrade_extensions.py new file mode 100644 index 00000000..da07c0c7 --- /dev/null +++ b/scripts/upgrade_extensions.py @@ -0,0 +1,45 @@ +import os +import os.path as osp +import shutil +import subprocess +import sys + + +HERE = osp.abspath(osp.dirname(__file__)) + +def get_exts(dname): + """Get the relative paths to all of the extensions""" + paths = [] + for path in os.listdir(dname): + if path in ['node_modules', '.git']: + continue + full_path = osp.join(dname, path) + package_path = osp.join(full_path, 'package.json') + if osp.exists(package_path): + paths.append(full_path) + elif osp.isdir(full_path): + paths.extend(get_exts(full_path)) + return paths + + +def main(): + """Upgrade all of the extensions""" + for ext in get_exts(osp.dirname(HERE)): + print(ext) + had_licence = osp.exists(osp.join(ext, 'LICENSE')) + subprocess.run([sys.executable, '-m', 'jupyterlab.upgrade_extension', '--no-input', ext]) + # Overwrite setup.py and pyproject.toml directly + for fname in ['setup.py', 'pyproject.toml']: + shutil.move(osp.join(ext, '_temp_extension', fname), osp.join(ext, fname)) + # Remove unused files from the cookiecutter + for fname in ['.prettierignore', '.prettierrc', 'LICENSE']: + if had_licence and fname == 'LICENSE': + continue + os.remove(osp.join(ext, fname)) + # Remove unused directories from the cookiecutter + for dname in ['.github', '_temp_extension']: + shutil.rmtree(osp.join(ext, dname)) + + +if __name__ == "__main__": + main() diff --git a/settings/MANIFEST.in b/settings/MANIFEST.in new file mode 100644 index 00000000..72283e74 --- /dev/null +++ b/settings/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_settings.json + +include package.json +include ts*.json + +graft jupyterlab_examples_settings/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/settings/README.md b/settings/README.md index 2e5460d5..d4fa19b2 100644 --- a/settings/README.md +++ b/settings/README.md @@ -109,12 +109,11 @@ the `package.json` file in the `jupyterlab` section (here `schema`): ```json5 -// package.json#L57-L60 +// package.json#L68-L70 "jupyterlab": { "extension": true, - "schemaDir": "schema" -} + "schemaDir": "schema", ``` diff --git a/settings/jupyterlab_examples_settings/__init__.py b/settings/jupyterlab_examples_settings/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/settings/jupyterlab_examples_settings/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/settings/jupyterlab_examples_settings/_version.py b/settings/jupyterlab_examples_settings/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/settings/jupyterlab_examples_settings/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/settings/package.json b/settings/package.json index 84fb3c61..5ab0de43 100644 --- a/settings/package.json +++ b/settings/package.json @@ -26,36 +26,48 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_settings/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@jupyterlab/settingregistry": "^2.0.0", - "@lumino/widgets": "^1.9.3" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/settingregistry": "~3.0.0-beta.3", + "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { "extension": true, - "schemaDir": "schema" + "schemaDir": "schema", + "outputDir": "jupyterlab_examples_settings/static" } -} +} \ No newline at end of file diff --git a/settings/pyproject.toml b/settings/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/settings/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/settings/setup.py b/settings/setup.py new file mode 100644 index 00000000..fd81711d --- /dev/null +++ b/settings/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_settings setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_settings" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/settings" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="A JupyterLab minimal example using settings.", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/state/MANIFEST.in b/state/MANIFEST.in new file mode 100644 index 00000000..5f1c8b43 --- /dev/null +++ b/state/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_state.json + +include package.json +include ts*.json + +graft jupyterlab_examples_state/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/state/jupyterlab_examples_state/__init__.py b/state/jupyterlab_examples_state/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/state/jupyterlab_examples_state/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/state/jupyterlab_examples_state/_version.py b/state/jupyterlab_examples_state/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/state/jupyterlab_examples_state/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/state/package.json b/state/package.json index 192f3fdc..46456489 100644 --- a/state/package.json +++ b/state/package.json @@ -25,35 +25,47 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_state/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/apputils": "^2.0.0", - "@jupyterlab/statedb": "^2.0.0", - "@lumino/coreutils": "^1.4.2" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/apputils": "~3.0.0-beta.3", + "@jupyterlab/statedb": "~3.0.0-beta.3", + "@lumino/coreutils": "^1.5.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_state/static" } -} +} \ No newline at end of file diff --git a/state/pyproject.toml b/state/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/state/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/state/setup.py b/state/setup.py new file mode 100644 index 00000000..7932cad9 --- /dev/null +++ b/state/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_state setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_state" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/state" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="A minimal JupyterLab example using state database (DB).", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) diff --git a/widget-tracker/widgets/MANIFEST.in b/widget-tracker/widgets/MANIFEST.in new file mode 100644 index 00000000..216005e6 --- /dev/null +++ b/widget-tracker/widgets/MANIFEST.in @@ -0,0 +1,22 @@ +include LICENSE +include README.md +include pyproject.toml +include jupyter-config/jupyterlab_examples_widgets.json + +include package.json +include ts*.json + +graft jupyterlab_examples_widgets/static + +# Javascript files +graft src +graft style +prune **/node_modules +prune lib + +# Patterns to exclude from any directory +global-exclude *~ +global-exclude *.pyc +global-exclude *.pyo +global-exclude .git +global-exclude .ipynb_checkpoints diff --git a/widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py b/widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py new file mode 100644 index 00000000..819e43e0 --- /dev/null +++ b/widget-tracker/widgets/jupyterlab_examples_widgets/__init__.py @@ -0,0 +1,19 @@ + +import json +import os.path as osp + +from ._version import __version__ + +HERE = osp.abspath(osp.dirname(__file__)) + +with open(osp.join(HERE, 'static', 'package.json')) as fid: + data = json.load(fid) + +def _jupyter_labextension_paths(): + return [{ + 'src': 'static', + 'dest': data['name'] + }] + + + diff --git a/widget-tracker/widgets/jupyterlab_examples_widgets/_version.py b/widget-tracker/widgets/jupyterlab_examples_widgets/_version.py new file mode 100644 index 00000000..ee864fc9 --- /dev/null +++ b/widget-tracker/widgets/jupyterlab_examples_widgets/_version.py @@ -0,0 +1,2 @@ +version_info = (0, 1, 0) +__version__ = ".".join(map(str, version_info)) diff --git a/widget-tracker/widgets/package.json b/widget-tracker/widgets/package.json index 27e3ab61..f493e717 100644 --- a/widget-tracker/widgets/package.json +++ b/widget-tracker/widgets/package.json @@ -25,36 +25,48 @@ "url": "https://github.com/jupyterlab/extension-examples.git" }, "scripts": { - "build": "tsc", - "clean": "rimraf lib tsconfig.tsbuildinfo", - "install-ext": "jupyter labextension install . --no-build", - "prepare": "jlpm run clean && jlpm run build", + "build": "jlpm run build:lib", + "build:all": "jlpm run build:lib && jlpm run build:labextension", + "build:labextension": "jupyter labextension build .", + "build:lib": "tsc", + "clean": "jlpm run clean:lib", + "clean:all": "jlpm run clean:lib && jlpm run clean:labextension", + "clean:labextension": "rimraf jupyterlab_examples_widgets/static", + "clean:lib": "rimraf lib tsconfig.tsbuildinfo", "eslint": "eslint . --ext .ts,.tsx --fix", "eslint:check": "eslint . --ext .ts,.tsx", - "watch": "tsc -w" + "install:extension": "jupyter labextension develop --overwrite .", + "prepare": "jlpm run clean && jlpm run build", + "watch": "run-p watch:src watch:labextension", + "watch:labextension": "jupyter labextension watch .", + "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "^2.0.0", - "@jupyterlab/mainmenu": "^2.0.0", - "@lumino/algorithm": "^1.2.0", - "@lumino/coreutils": "^1.3.1", - "@lumino/disposable": "^1.3.1" + "@jupyterlab/application": "~3.0.0-beta.3", + "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@lumino/algorithm": "^1.3.3", + "@lumino/coreutils": "^1.5.3", + "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^2.21.0", - "@typescript-eslint/parser": "^2.21.0", - "eslint": "^6.8.0", - "eslint-config-prettier": "^6.10.0", + "@jupyterlab/builder": "^3.0.0-beta.3", + "@typescript-eslint/eslint-plugin": "^2.27.0", + "@typescript-eslint/parser": "^2.27.0", + "eslint": "^7.5.0", + "eslint-config-prettier": "^6.10.1", "eslint-plugin-jsdoc": "^22.0.0", "eslint-plugin-prettier": "^3.1.2", "eslint-plugin-react": "^7.18.3", - "rimraf": "^3.0.0", - "typescript": "~3.7.5" + "npm-run-all": "^4.1.5", + "prettier": "^1.19.0", + "rimraf": "^3.0.2", + "typescript": "~3.9.0" }, "sideEffects": [ "style/*.css" ], "jupyterlab": { - "extension": true + "extension": true, + "outputDir": "jupyterlab_examples_widgets/static" } -} +} \ No newline at end of file diff --git a/widget-tracker/widgets/pyproject.toml b/widget-tracker/widgets/pyproject.toml new file mode 100644 index 00000000..873d43f4 --- /dev/null +++ b/widget-tracker/widgets/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/widget-tracker/widgets/setup.py b/widget-tracker/widgets/setup.py new file mode 100644 index 00000000..a7e2a139 --- /dev/null +++ b/widget-tracker/widgets/setup.py @@ -0,0 +1,87 @@ +""" +jupyterlab_examples_widgets setup +""" +import os + +from jupyter_packaging import ( + create_cmdclass, install_npm, ensure_targets, + combine_commands, ensure_python, get_version, +) +import setuptools + +HERE = os.path.abspath(os.path.dirname(__file__)) + +# The name of the project +name="jupyterlab_examples_widgets" + +# Ensure a valid python version +ensure_python(">=3.6") + +# Get our version +version = get_version(os.path.join(name, "_version.py")) + +lab_path = os.path.join(HERE, name, "static") + +# Representative files that should exist after a successful build +jstargets = [ + os.path.join(HERE, "lib", "index.js"), + os.path.join(HERE, name, "static", "package.json"), +] + +package_data_spec = { + name: [ + "*" + ] +} + +labext_name = "@jupyterlab-examples/widgets" + +data_files_spec = [ + ("share/jupyter/labextensions/%s" % labext_name, lab_path, "*.*"), +] + +cmdclass = create_cmdclass("jsdeps", + package_data_spec=package_data_spec, + data_files_spec=data_files_spec +) + +cmdclass["jsdeps"] = combine_commands( + install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), + ensure_targets(jstargets), +) + +with open("README.md", "r") as fh: + long_description = fh.read() + +setup_args = dict( + name=name, + version=version, + url="https://github.com/jupyterlab/extension-examples.git", + author="Project Jupyter Contributors", + description="minimal lab example", + long_description= long_description, + long_description_content_type="text/markdown", + cmdclass= cmdclass, + packages=setuptools.find_packages(), + install_requires=[ + "jupyterlab~=3.0.0b3", + ], + zip_safe=False, + include_package_data=True, + license="BSD-3-Clause", + platforms="Linux, Mac OS X, Windows", + keywords=["Jupyter", "JupyterLab"], + classifiers=[ + "License :: OSI Approved :: BSD License", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Framework :: Jupyter", + ], +) + + +if __name__ == "__main__": + setuptools.setup(**setup_args) From 2ea40c8de39855200c2812068305c2bc905962d2 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 10 Sep 2020 20:09:30 -0500 Subject: [PATCH 5/8] reinstate launcher license file --- launcher/LICENSE | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 launcher/LICENSE diff --git a/launcher/LICENSE b/launcher/LICENSE new file mode 100644 index 00000000..5df00610 --- /dev/null +++ b/launcher/LICENSE @@ -0,0 +1,30 @@ +BSD 3-Clause License + +Copyright (c) 2019, Jeremy Tuloup +Copyright (c) 2019, Jupyter Development Team +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +3. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 37946dacc002a3f3ba3dbc071d962c53892ca5e1 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Thu, 10 Sep 2020 20:12:44 -0500 Subject: [PATCH 6/8] ignore static files --- .prettierignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.prettierignore b/.prettierignore index 8103ecd2..3a5875d7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -2,3 +2,4 @@ node_modules **/node_modules **/lib **/package.json +**/static From 697ad67e82cabb769706fa9fcd9ec058bf80c621 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 11 Sep 2020 14:33:43 -0500 Subject: [PATCH 7/8] run upgrade script --- advanced/kernel-messaging/package.json | 10 +++++----- advanced/kernel-messaging/pyproject.toml | 2 +- advanced/kernel-messaging/setup.py | 8 +++----- advanced/kernel-output/package.json | 10 +++++----- advanced/kernel-output/pyproject.toml | 2 +- advanced/kernel-output/setup.py | 8 +++----- advanced/server-extension/package.json | 10 +++++----- advanced/server-extension/pyproject.toml | 2 +- advanced/server-extension/setup.py | 8 +++----- basics/datagrid/package.json | 6 +++--- basics/datagrid/pyproject.toml | 2 +- basics/datagrid/setup.py | 8 +++----- basics/hello-world/package.json | 4 ++-- basics/hello-world/pyproject.toml | 2 +- basics/hello-world/setup.py | 8 +++----- basics/signals/package.json | 8 ++++---- basics/signals/pyproject.toml | 2 +- basics/signals/setup.py | 8 +++----- command-palette/package.json | 4 ++-- command-palette/pyproject.toml | 2 +- command-palette/setup.py | 8 +++----- commands/package.json | 4 ++-- commands/pyproject.toml | 2 +- commands/setup.py | 8 +++----- context-menu/package.json | 10 +++++----- context-menu/pyproject.toml | 2 +- context-menu/setup.py | 8 +++----- launcher/package.json | 10 +++++----- launcher/pyproject.toml | 2 +- launcher/setup.py | 8 +++----- log-console/custom-log-console/package.json | 18 ++++++++--------- log-console/custom-log-console/pyproject.toml | 2 +- log-console/custom-log-console/setup.py | 8 +++----- log-console/log-messages/package.json | 20 +++++++++---------- log-console/log-messages/pyproject.toml | 2 +- log-console/log-messages/setup.py | 8 +++----- main-menu/package.json | 6 +++--- main-menu/pyproject.toml | 2 +- main-menu/setup.py | 8 +++----- react/react-widget/package.json | 8 ++++---- react/react-widget/pyproject.toml | 2 +- react/react-widget/setup.py | 8 +++----- settings/package.json | 8 ++++---- settings/pyproject.toml | 2 +- settings/setup.py | 8 +++----- state/package.json | 8 ++++---- state/pyproject.toml | 2 +- state/setup.py | 8 +++----- widget-tracker/widgets/package.json | 6 +++--- widget-tracker/widgets/pyproject.toml | 2 +- widget-tracker/widgets/setup.py | 8 +++----- 51 files changed, 143 insertions(+), 177 deletions(-) diff --git a/advanced/kernel-messaging/package.json b/advanced/kernel-messaging/package.json index d4b535cf..e90a6bab 100644 --- a/advanced/kernel-messaging/package.json +++ b/advanced/kernel-messaging/package.json @@ -42,10 +42,10 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/launcher": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", - "@jupyterlab/nbformat": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/launcher": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", + "@jupyterlab/nbformat": "~3.0.0-beta.4", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.5.2", @@ -53,7 +53,7 @@ "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/advanced/kernel-messaging/pyproject.toml b/advanced/kernel-messaging/pyproject.toml index 873d43f4..63a68190 100644 --- a/advanced/kernel-messaging/pyproject.toml +++ b/advanced/kernel-messaging/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/advanced/kernel-messaging/setup.py b/advanced/kernel-messaging/setup.py index f6b64820..14cd71ba 100644 --- a/advanced/kernel-messaging/setup.py +++ b/advanced/kernel-messaging/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_kernel_messaging" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/advanced/kernel-output/package.json b/advanced/kernel-output/package.json index 40cd3867..b319903b 100644 --- a/advanced/kernel-output/package.json +++ b/advanced/kernel-output/package.json @@ -42,17 +42,17 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/launcher": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", - "@jupyterlab/outputarea": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/launcher": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", + "@jupyterlab/outputarea": "~3.0.0-beta.4", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.3.1", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/advanced/kernel-output/pyproject.toml b/advanced/kernel-output/pyproject.toml index 873d43f4..63a68190 100644 --- a/advanced/kernel-output/pyproject.toml +++ b/advanced/kernel-output/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/advanced/kernel-output/setup.py b/advanced/kernel-output/setup.py index c2341904..7d3b884e 100644 --- a/advanced/kernel-output/setup.py +++ b/advanced/kernel-output/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_kernel_output" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/advanced/server-extension/package.json b/advanced/server-extension/package.json index 50fa1f26..57fee635 100644 --- a/advanced/server-extension/package.json +++ b/advanced/server-extension/package.json @@ -42,13 +42,13 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/coreutils": "~5.0.0-beta.3", - "@jupyterlab/launcher": "~3.0.0-beta.3", - "@jupyterlab/services": "~6.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/coreutils": "~5.0.0-beta.4", + "@jupyterlab/launcher": "~3.0.0-beta.4", + "@jupyterlab/services": "~6.0.0-beta.4" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/advanced/server-extension/pyproject.toml b/advanced/server-extension/pyproject.toml index 873d43f4..63a68190 100644 --- a/advanced/server-extension/pyproject.toml +++ b/advanced/server-extension/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/advanced/server-extension/setup.py b/advanced/server-extension/setup.py index 9631d2da..09eb1339 100644 --- a/advanced/server-extension/setup.py +++ b/advanced/server-extension/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jlab_ext_example" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -66,10 +63,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/basics/datagrid/package.json b/basics/datagrid/package.json index ce2738f5..adf49a97 100644 --- a/basics/datagrid/package.json +++ b/basics/datagrid/package.json @@ -42,15 +42,15 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.5.2", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/basics/datagrid/pyproject.toml b/basics/datagrid/pyproject.toml index 873d43f4..63a68190 100644 --- a/basics/datagrid/pyproject.toml +++ b/basics/datagrid/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/basics/datagrid/setup.py b/basics/datagrid/setup.py index 54b85be6..75dd7522 100644 --- a/basics/datagrid/setup.py +++ b/basics/datagrid/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_datagrid" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/basics/hello-world/package.json b/basics/hello-world/package.json index 8e796d21..ef1a25af 100644 --- a/basics/hello-world/package.json +++ b/basics/hello-world/package.json @@ -42,10 +42,10 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/basics/hello-world/pyproject.toml b/basics/hello-world/pyproject.toml index 873d43f4..63a68190 100644 --- a/basics/hello-world/pyproject.toml +++ b/basics/hello-world/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/basics/hello-world/setup.py b/basics/hello-world/setup.py index 56c37399..e60363e1 100644 --- a/basics/hello-world/setup.py +++ b/basics/hello-world/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_hello_world" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/basics/signals/package.json b/basics/signals/package.json index 16c25b3f..ff455bb3 100644 --- a/basics/signals/package.json +++ b/basics/signals/package.json @@ -42,16 +42,16 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/launcher": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/launcher": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/datagrid": "^0.3.1", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/basics/signals/pyproject.toml b/basics/signals/pyproject.toml index 873d43f4..63a68190 100644 --- a/basics/signals/pyproject.toml +++ b/basics/signals/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/basics/signals/setup.py b/basics/signals/setup.py index fe5de71d..c2c69f5e 100644 --- a/basics/signals/setup.py +++ b/basics/signals/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_signals" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/command-palette/package.json b/command-palette/package.json index 6fd52106..31a98aa9 100644 --- a/command-palette/package.json +++ b/command-palette/package.json @@ -42,10 +42,10 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/command-palette/pyproject.toml b/command-palette/pyproject.toml index 873d43f4..63a68190 100644 --- a/command-palette/pyproject.toml +++ b/command-palette/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/command-palette/setup.py b/command-palette/setup.py index 0d7a3d1a..22df5427 100644 --- a/command-palette/setup.py +++ b/command-palette/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_command_palette" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/commands/package.json b/commands/package.json index 05157984..b0c611ed 100644 --- a/commands/package.json +++ b/commands/package.json @@ -42,10 +42,10 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/commands/pyproject.toml b/commands/pyproject.toml index 873d43f4..63a68190 100644 --- a/commands/pyproject.toml +++ b/commands/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/commands/setup.py b/commands/setup.py index 0f4eab13..dcd196c8 100644 --- a/commands/setup.py +++ b/commands/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_commands" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/context-menu/package.json b/context-menu/package.json index ae7c9b0e..b3d05e9d 100644 --- a/context-menu/package.json +++ b/context-menu/package.json @@ -42,13 +42,13 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/apputils": "~3.0.0-beta.3", - "@jupyterlab/filebrowser": "~3.0.0-beta.3", - "@jupyterlab/ui-components": "~3.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/apputils": "~3.0.0-beta.4", + "@jupyterlab/filebrowser": "~3.0.0-beta.4", + "@jupyterlab/ui-components": "~3.0.0-beta.4" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/context-menu/pyproject.toml b/context-menu/pyproject.toml index 873d43f4..63a68190 100644 --- a/context-menu/pyproject.toml +++ b/context-menu/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/context-menu/setup.py b/context-menu/setup.py index f6f9ec16..5aec8143 100644 --- a/context-menu/setup.py +++ b/context-menu/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_context_menu" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/launcher/package.json b/launcher/package.json index 7250966c..e914d1c0 100644 --- a/launcher/package.json +++ b/launcher/package.json @@ -42,13 +42,13 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/filebrowser": "~3.0.0-beta.3", - "@jupyterlab/launcher": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/filebrowser": "~3.0.0-beta.4", + "@jupyterlab/launcher": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/launcher/pyproject.toml b/launcher/pyproject.toml index 873d43f4..63a68190 100644 --- a/launcher/pyproject.toml +++ b/launcher/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/launcher/setup.py b/launcher/setup.py index 108459fc..4530d029 100644 --- a/launcher/setup.py +++ b/launcher/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_launcher" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/log-console/custom-log-console/package.json b/log-console/custom-log-console/package.json index 8be681cf..27c86c70 100644 --- a/log-console/custom-log-console/package.json +++ b/log-console/custom-log-console/package.json @@ -42,19 +42,19 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/apputils": "~3.0.0-beta.3", - "@jupyterlab/coreutils": "~5.0.0-beta.3", - "@jupyterlab/logconsole": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", - "@jupyterlab/nbformat": "~3.0.0-beta.3", - "@jupyterlab/rendermime": "~3.0.0-beta.3", - "@jupyterlab/ui-components": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/apputils": "~3.0.0-beta.4", + "@jupyterlab/coreutils": "~5.0.0-beta.4", + "@jupyterlab/logconsole": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", + "@jupyterlab/nbformat": "~3.0.0-beta.4", + "@jupyterlab/rendermime": "~3.0.0-beta.4", + "@jupyterlab/ui-components": "~3.0.0-beta.4", "@lumino/coreutils": "^1.5.3", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/log-console/custom-log-console/pyproject.toml b/log-console/custom-log-console/pyproject.toml index 873d43f4..63a68190 100644 --- a/log-console/custom-log-console/pyproject.toml +++ b/log-console/custom-log-console/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/log-console/custom-log-console/setup.py b/log-console/custom-log-console/setup.py index 327f52ae..25e9cfef 100644 --- a/log-console/custom-log-console/setup.py +++ b/log-console/custom-log-console/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_custom_log_console" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/log-console/log-messages/package.json b/log-console/log-messages/package.json index d7f47e22..666358dd 100644 --- a/log-console/log-messages/package.json +++ b/log-console/log-messages/package.json @@ -42,20 +42,20 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/apputils": "~3.0.0-beta.3", - "@jupyterlab/coreutils": "~5.0.0-beta.3", - "@jupyterlab/logconsole": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", - "@jupyterlab/nbformat": "~3.0.0-beta.3", - "@jupyterlab/notebook": "~3.0.0-beta.3", - "@jupyterlab/rendermime": "~3.0.0-beta.3", - "@jupyterlab/ui-components": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/apputils": "~3.0.0-beta.4", + "@jupyterlab/coreutils": "~5.0.0-beta.4", + "@jupyterlab/logconsole": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", + "@jupyterlab/nbformat": "~3.0.0-beta.4", + "@jupyterlab/notebook": "~3.0.0-beta.4", + "@jupyterlab/rendermime": "~3.0.0-beta.4", + "@jupyterlab/ui-components": "~3.0.0-beta.4", "@lumino/coreutils": "^1.5.3", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/log-console/log-messages/pyproject.toml b/log-console/log-messages/pyproject.toml index 873d43f4..63a68190 100644 --- a/log-console/log-messages/pyproject.toml +++ b/log-console/log-messages/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/log-console/log-messages/setup.py b/log-console/log-messages/setup.py index 4efff72f..3d63b80b 100644 --- a/log-console/log-messages/setup.py +++ b/log-console/log-messages/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_log_messages" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/main-menu/package.json b/main-menu/package.json index 48aa1810..94dbfff6 100644 --- a/main-menu/package.json +++ b/main-menu/package.json @@ -42,12 +42,12 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/main-menu/pyproject.toml b/main-menu/pyproject.toml index 873d43f4..63a68190 100644 --- a/main-menu/pyproject.toml +++ b/main-menu/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/main-menu/setup.py b/main-menu/setup.py index 3a043ed3..4c325db1 100644 --- a/main-menu/setup.py +++ b/main-menu/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_main_menu" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/react/react-widget/package.json b/react/react-widget/package.json index a6ccbf96..2e381233 100644 --- a/react/react-widget/package.json +++ b/react/react-widget/package.json @@ -42,12 +42,12 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/launcher": "~3.0.0-beta.3", - "@jupyterlab/ui-components": "~3.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/launcher": "~3.0.0-beta.4", + "@jupyterlab/ui-components": "~3.0.0-beta.4" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/react/react-widget/pyproject.toml b/react/react-widget/pyproject.toml index 873d43f4..63a68190 100644 --- a/react/react-widget/pyproject.toml +++ b/react/react-widget/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/react/react-widget/setup.py b/react/react-widget/setup.py index 03c61ead..74ae2915 100644 --- a/react/react-widget/setup.py +++ b/react/react-widget/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_react_widget" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/settings/package.json b/settings/package.json index 5ab0de43..a7ff6be8 100644 --- a/settings/package.json +++ b/settings/package.json @@ -43,13 +43,13 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", - "@jupyterlab/settingregistry": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", + "@jupyterlab/settingregistry": "~3.0.0-beta.4", "@lumino/widgets": "^1.14.0" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/settings/pyproject.toml b/settings/pyproject.toml index 873d43f4..63a68190 100644 --- a/settings/pyproject.toml +++ b/settings/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/settings/setup.py b/settings/setup.py index fd81711d..adc60f60 100644 --- a/settings/setup.py +++ b/settings/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_settings" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/state/package.json b/state/package.json index 46456489..31a1fcfb 100644 --- a/state/package.json +++ b/state/package.json @@ -42,13 +42,13 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/apputils": "~3.0.0-beta.3", - "@jupyterlab/statedb": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/apputils": "~3.0.0-beta.4", + "@jupyterlab/statedb": "~3.0.0-beta.4", "@lumino/coreutils": "^1.5.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/state/pyproject.toml b/state/pyproject.toml index 873d43f4..63a68190 100644 --- a/state/pyproject.toml +++ b/state/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/state/setup.py b/state/setup.py index 7932cad9..73371eb4 100644 --- a/state/setup.py +++ b/state/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_state" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], diff --git a/widget-tracker/widgets/package.json b/widget-tracker/widgets/package.json index f493e717..6b8c32be 100644 --- a/widget-tracker/widgets/package.json +++ b/widget-tracker/widgets/package.json @@ -42,14 +42,14 @@ "watch:src": "tsc -w" }, "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", "@lumino/algorithm": "^1.3.3", "@lumino/coreutils": "^1.5.3", "@lumino/disposable": "^1.4.3" }, "devDependencies": { - "@jupyterlab/builder": "^3.0.0-beta.3", + "@jupyterlab/builder": "^3.0.0-beta.4", "@typescript-eslint/eslint-plugin": "^2.27.0", "@typescript-eslint/parser": "^2.27.0", "eslint": "^7.5.0", diff --git a/widget-tracker/widgets/pyproject.toml b/widget-tracker/widgets/pyproject.toml index 873d43f4..63a68190 100644 --- a/widget-tracker/widgets/pyproject.toml +++ b/widget-tracker/widgets/pyproject.toml @@ -1,3 +1,3 @@ [build-system] -requires = ["jupyter_packaging~=0.6.0", "jupyterlab~=3.0.0b3", "setuptools>=40.8.0", "wheel"] +requires = ["jupyter_packaging~=0.7.0", "jupyterlab~=3.0.0b4", "setuptools>=40.8.0", "wheel"] build-backend = "setuptools.build_meta" diff --git a/widget-tracker/widgets/setup.py b/widget-tracker/widgets/setup.py index a7e2a139..a0933efd 100644 --- a/widget-tracker/widgets/setup.py +++ b/widget-tracker/widgets/setup.py @@ -5,7 +5,7 @@ from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -14,9 +14,6 @@ # The name of the project name="jupyterlab_examples_widgets" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -64,10 +61,11 @@ cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], From ea78b875b952f5906764862181cd302e0d180701 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Fri, 11 Sep 2020 14:36:37 -0500 Subject: [PATCH 8/8] update readmes --- advanced/server-extension/README.md | 15 ++++++--------- basics/hello-world/README.md | 2 +- main-menu/README.md | 4 ++-- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/advanced/server-extension/README.md b/advanced/server-extension/README.md index a046dfd2..b7d5f0e3 100644 --- a/advanced/server-extension/README.md +++ b/advanced/server-extension/README.md @@ -501,7 +501,7 @@ import os from jupyter_packaging import ( create_cmdclass, install_npm, ensure_targets, - combine_commands, ensure_python, get_version, + combine_commands, get_version, ) import setuptools @@ -510,9 +510,6 @@ HERE = os.path.abspath(os.path.dirname(__file__)) # The name of the project name="jlab_ext_example" -# Ensure a valid python version -ensure_python(">=3.6") - # Get our version version = get_version(os.path.join(name, "_version.py")) @@ -562,10 +559,11 @@ setup_args = dict( cmdclass= cmdclass, packages=setuptools.find_packages(), install_requires=[ - "jupyterlab~=3.0.0b3", + "jupyterlab~=3.0.0b4", ], zip_safe=False, include_package_data=True, + python_requires=">=3.6", license="BSD-3-Clause", platforms="Linux, Mac OS X, Windows", keywords=["Jupyter", "JupyterLab"], @@ -584,7 +582,6 @@ setup_args = dict( if __name__ == "__main__": setuptools.setup(**setup_args) - ``` But in this case, it is a bit more complicated to build the frontend extension and ship it @@ -593,7 +590,7 @@ the frontend NPM package needs to be built and inserted in the Python package. T done using a special `cmdclass`: ```py -# setup.py#L45-L53 +# setup.py#L42-L50 cmdclass = create_cmdclass("jsdeps", package_data_spec=package_data_spec, @@ -609,7 +606,7 @@ cmdclass["jsdeps"] = combine_commands( Basically it will build the frontend NPM package: ```py -# setup.py#L51-L51 +# setup.py#L48-L48 install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), ``` @@ -617,7 +614,7 @@ install_npm(HERE, build_cmd="build:all", npm=["jlpm"]), It will ensure one of the generated JS files is `lib/jlabextexample.js`: ```py -# setup.py#L26-L29 +# setup.py#L23-L26 jstargets = [ os.path.join(HERE, "lib", "index.js"), diff --git a/basics/hello-world/README.md b/basics/hello-world/README.md index 4ea18e27..8e14b0e7 100644 --- a/basics/hello-world/README.md +++ b/basics/hello-world/README.md @@ -94,7 +94,7 @@ package is declared in the file `package.json`: // package.json#L44-L46 "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3" + "@jupyterlab/application": "~3.0.0-beta.4" }, ``` diff --git a/main-menu/README.md b/main-menu/README.md index d3fda127..cbf005c1 100644 --- a/main-menu/README.md +++ b/main-menu/README.md @@ -88,8 +88,8 @@ After the execution of that command, `package.json` should list them in the // package.json#L44-L48 "dependencies": { - "@jupyterlab/application": "~3.0.0-beta.3", - "@jupyterlab/mainmenu": "~3.0.0-beta.3", + "@jupyterlab/application": "~3.0.0-beta.4", + "@jupyterlab/mainmenu": "~3.0.0-beta.4", "@lumino/widgets": "^1.14.0" }, ```