diff --git a/.copier-answers.yml b/.copier-answers.yml index 456d263..20071d8 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,14 +1,12 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY _commit: v4.1.0 _src_path: https://github.com/jupyterlab/extension-template -author_email: ii@entap.co.jp -author_name: ii masamitsu has_binder: true has_settings: true kind: frontend labextension_name: lc_multi_outputs project_short_description: Multiple outputs as tabs python_name: lc_multi_outputs -repository: https://github.com/entap/lc_multi_outputs.git +repository: https://github.com/NII-cloud-operation/Jupyter-multi_outputs.git test: false diff --git a/README_2.md b/README_2.md deleted file mode 100644 index e6bb16e..0000000 --- a/README_2.md +++ /dev/null @@ -1,76 +0,0 @@ -# lc_multi_outputs - -[![Github Actions Status](https://github.com/entap/lc_multi_outputs/workflows/Build/badge.svg)](https://github.com/entap/lc_multi_outputs/actions/workflows/build.yml)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entap/lc_multi_outputs/main?urlpath=lab) -Multiple outputs as tabs - -## Requirements - -- JupyterLab >= 3.0 - -## Install - -To install the extension, execute: - -```bash -pip install lc_multi_outputs -``` - -## Uninstall - -To remove the extension, execute: - -```bash -pip uninstall lc_multi_outputs -``` - -## Contributing - -### Development install - -Note: You will need NodeJS to build the extension package. - -The `jlpm` command is JupyterLab's pinned version of -[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use -`yarn` or `npm` in lieu of `jlpm` below. - -```bash -# Clone the repo to your local environment -# Change directory to the lc_multi_outputs directory -# Install package in development mode -pip install -e . -# Link your development version of the extension with JupyterLab -jupyter labextension develop . --overwrite -# Rebuild extension Typescript source after making changes -jlpm build -``` - -You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. - -```bash -# Watch the source directory in one terminal, automatically rebuilding when needed -jlpm watch -# Run JupyterLab in another terminal -jupyter lab -``` - -With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). - -By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: - -```bash -jupyter lab build --minimize=False -``` - -### Development uninstall - -```bash -pip uninstall lc_multi_outputs -``` - -In development mode, you will also need to remove the symlink created by `jupyter labextension develop` -command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions` -folder is located. Then you can remove the symlink named `lc_multi_outputs` within that folder. - -### Packaging the extension - -See [RELEASE](RELEASE.md) diff --git a/_temp_extension/.copier-answers.yml b/_temp_extension/.copier-answers.yml deleted file mode 100644 index 456d263..0000000 --- a/_temp_extension/.copier-answers.yml +++ /dev/null @@ -1,14 +0,0 @@ -# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: v4.1.0 -_src_path: https://github.com/jupyterlab/extension-template -author_email: ii@entap.co.jp -author_name: ii masamitsu -has_binder: true -has_settings: true -kind: frontend -labextension_name: lc_multi_outputs -project_short_description: Multiple outputs as tabs -python_name: lc_multi_outputs -repository: https://github.com/entap/lc_multi_outputs.git -test: false - diff --git a/_temp_extension/.github/workflows/binder-on-pr.yml b/_temp_extension/.github/workflows/binder-on-pr.yml deleted file mode 100644 index 87e9cd2..0000000 --- a/_temp_extension/.github/workflows/binder-on-pr.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Binder Badge -on: - pull_request_target: - types: [opened] - -jobs: - binder: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1 - with: - github_token: ${{ secrets.github_token }} diff --git a/_temp_extension/.github/workflows/build.yml b/_temp_extension/.github/workflows/build.yml deleted file mode 100644 index 5b05f15..0000000 --- a/_temp_extension/.github/workflows/build.yml +++ /dev/null @@ -1,88 +0,0 @@ -name: Build - -on: - push: - branches: main - pull_request: - branches: '*' - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - - name: Install dependencies - run: python -m pip install -U "jupyterlab>=4.0.0,<5" - - - name: Lint the extension - run: | - set -eux - jlpm - jlpm run lint:check - - - name: Build the extension - run: | - set -eux - python -m pip install .[test] - - jupyter labextension list - jupyter labextension list 2>&1 | grep -ie "lc_multi_outputs.*OK" - python -m jupyterlab.browser_check - - - name: Package the extension - run: | - set -eux - - pip install build - python -m build - pip uninstall -y "lc_multi_outputs" jupyterlab - - - name: Upload extension packages - uses: actions/upload-artifact@v3 - with: - name: extension-artifacts - path: dist/lc_multi_outputs* - if-no-files-found: error - - test_isolated: - needs: build - runs-on: ubuntu-latest - - steps: - - name: Install Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - architecture: 'x64' - - uses: actions/download-artifact@v3 - with: - name: extension-artifacts - - name: Install and Test - run: | - set -eux - # Remove NodeJS, twice to take care of system and locally installed node versions. - sudo rm -rf $(which node) - sudo rm -rf $(which node) - - pip install "jupyterlab>=4.0.0,<5" lc_multi_outputs*.whl - - - jupyter labextension list - jupyter labextension list 2>&1 | grep -ie "lc_multi_outputs.*OK" - python -m jupyterlab.browser_check --no-browser-test - - - check_links: - name: Check Links - runs-on: ubuntu-latest - timeout-minutes: 15 - steps: - - uses: actions/checkout@v3 - - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 diff --git a/_temp_extension/.github/workflows/check-release.yml b/_temp_extension/.github/workflows/check-release.yml deleted file mode 100644 index f3c1080..0000000 --- a/_temp_extension/.github/workflows/check-release.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Check Release -on: - push: - branches: ["main"] - pull_request: - branches: ["*"] - -jobs: - check_release: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Base Setup - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - name: Install Dependencies - run: | - pip install -e . - - name: Check Release - uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v2 - with: - - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload Distributions - uses: actions/upload-artifact@v3 - with: - name: lc_multi_outputs-releaser-dist-${{ github.run_number }} - path: .jupyter_releaser_checkout/dist diff --git a/_temp_extension/.github/workflows/enforce-label.yml b/_temp_extension/.github/workflows/enforce-label.yml deleted file mode 100644 index 725feab..0000000 --- a/_temp_extension/.github/workflows/enforce-label.yml +++ /dev/null @@ -1,13 +0,0 @@ -name: Enforce PR label - -on: - pull_request: - types: [labeled, unlabeled, opened, edited, synchronize] -jobs: - enforce-label: - runs-on: ubuntu-latest - permissions: - pull-requests: write - steps: - - name: enforce-triage-label - uses: jupyterlab/maintainer-tools/.github/actions/enforce-label@v1 diff --git a/_temp_extension/.github/workflows/prep-release.yml b/_temp_extension/.github/workflows/prep-release.yml deleted file mode 100644 index 6f09281..0000000 --- a/_temp_extension/.github/workflows/prep-release.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: "Step 1: Prep Release" -on: - workflow_dispatch: - inputs: - version_spec: - description: "New Version Specifier" - default: "next" - required: false - branch: - description: "The branch to target" - required: false - post_version_spec: - description: "Post Version Specifier" - required: false - since: - description: "Use PRs with activity since this date or git reference" - required: false - since_last_stable: - description: "Use PRs with activity since the last stable git tag" - required: false - type: boolean -jobs: - prep_release: - runs-on: ubuntu-latest - steps: - - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - - name: Prep Release - id: prep-release - uses: jupyter-server/jupyter_releaser/.github/actions/prep-release@v2 - with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - version_spec: ${{ github.event.inputs.version_spec }} - post_version_spec: ${{ github.event.inputs.post_version_spec }} - branch: ${{ github.event.inputs.branch }} - since: ${{ github.event.inputs.since }} - since_last_stable: ${{ github.event.inputs.since_last_stable }} - - - name: "** Next Step **" - run: | - echo "Optional): Review Draft Release: ${{ steps.prep-release.outputs.release_url }}" diff --git a/_temp_extension/.github/workflows/publish-release.yml b/_temp_extension/.github/workflows/publish-release.yml deleted file mode 100644 index 1ddf2e2..0000000 --- a/_temp_extension/.github/workflows/publish-release.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: "Step 2: Publish Release" -on: - workflow_dispatch: - inputs: - branch: - description: "The target branch" - required: false - release_url: - description: "The URL of the draft GitHub release" - required: false - steps_to_skip: - description: "Comma separated list of steps to skip" - required: false - -jobs: - publish_release: - runs-on: ubuntu-latest - permissions: - # This is useful if you want to use PyPI trusted publisher - # and NPM provenance - id-token: write - steps: - - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - - - name: Populate Release - id: populate-release - uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2 - with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - branch: ${{ github.event.inputs.branch }} - release_url: ${{ github.event.inputs.release_url }} - steps_to_skip: ${{ github.event.inputs.steps_to_skip }} - - - name: Finalize Release - id: finalize-release - env: - # The following are needed if you use legacy PyPI set up - # PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} - # PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }} - # TWINE_USERNAME: __token__ - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - uses: jupyter-server/jupyter-releaser/.github/actions/finalize-release@v2 - with: - token: ${{ secrets.ADMIN_GITHUB_TOKEN }} - release_url: ${{ steps.populate-release.outputs.release_url }} - - - name: "** Next Step **" - if: ${{ success() }} - run: | - echo "Verify the final release" - echo ${{ steps.finalize-release.outputs.release_url }} - - - name: "** Failure Message **" - if: ${{ failure() }} - run: | - echo "Failed to Publish the Draft Release Url:" - echo ${{ steps.populate-release.outputs.release_url }} diff --git a/_temp_extension/.gitignore b/_temp_extension/.gitignore deleted file mode 100644 index ad4b929..0000000 --- a/_temp_extension/.gitignore +++ /dev/null @@ -1,121 +0,0 @@ -*.bundle.* -lib/ -node_modules/ -*.log -.eslintcache -.stylelintcache -*.egg-info/ -.ipynb_checkpoints -*.tsbuildinfo -lc_multi_outputs/labextension -# Version file is handled by hatchling -lc_multi_outputs/_version.py - -# Created by https://www.gitignore.io/api/python -# Edit at https://www.gitignore.io/?templates=python - -### Python ### -# Byte-compiled / optimized / DLL files -__pycache__/ -*.py[cod] -*$py.class - -# C extensions -*.so - -# Distribution / packaging -.Python -build/ -develop-eggs/ -dist/ -downloads/ -eggs/ -.eggs/ -lib/ -lib64/ -parts/ -sdist/ -var/ -wheels/ -pip-wheel-metadata/ -share/python-wheels/ -.installed.cfg -*.egg -MANIFEST - -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - -# Installer logs -pip-log.txt -pip-delete-this-directory.txt - -# Unit test / coverage reports -htmlcov/ -.tox/ -.nox/ -.coverage -.coverage.* -.cache -nosetests.xml -coverage/ -coverage.xml -*.cover -.hypothesis/ -.pytest_cache/ - -# Translations -*.mo -*.pot - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# pyenv -.python-version - -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# Mr Developer -.mr.developer.cfg -.project -.pydevproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# End of https://www.gitignore.io/api/python - -# OSX files -.DS_Store - -# Yarn cache -.yarn/ diff --git a/_temp_extension/.prettierignore b/_temp_extension/.prettierignore deleted file mode 100644 index 461dbba..0000000 --- a/_temp_extension/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -node_modules -**/node_modules -**/lib -**/package.json -!/package.json -lc_multi_outputs diff --git a/_temp_extension/.yarnrc.yml b/_temp_extension/.yarnrc.yml deleted file mode 100644 index fe1125f..0000000 --- a/_temp_extension/.yarnrc.yml +++ /dev/null @@ -1,3 +0,0 @@ -enableImmutableInstalls: false - -nodeLinker: node-modules diff --git a/_temp_extension/CHANGELOG.md b/_temp_extension/CHANGELOG.md deleted file mode 100644 index 2d352af..0000000 --- a/_temp_extension/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# Changelog - - - - diff --git a/_temp_extension/LICENSE b/_temp_extension/LICENSE deleted file mode 100644 index f4fd187..0000000 --- a/_temp_extension/LICENSE +++ /dev/null @@ -1,29 +0,0 @@ -BSD 3-Clause License - -Copyright (c) 2023, ii masamitsu -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. diff --git a/_temp_extension/README.md b/_temp_extension/README.md deleted file mode 100644 index f22d9e4..0000000 --- a/_temp_extension/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# lc_multi_outputs - -[![Github Actions Status](https://github.com/entap/lc_multi_outputs.git/workflows/Build/badge.svg)](https://github.com/entap/lc_multi_outputs.git/actions/workflows/build.yml)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/entap/lc_multi_outputs.git/main?urlpath=lab) -Multiple outputs as tabs - -## Requirements - -- JupyterLab >= 4.0.0 - -## Install - -To install the extension, execute: - -```bash -pip install lc_multi_outputs -``` - -## Uninstall - -To remove the extension, execute: - -```bash -pip uninstall lc_multi_outputs -``` - -## Contributing - -### Development install - -Note: You will need NodeJS to build the extension package. - -The `jlpm` command is JupyterLab's pinned version of -[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use -`yarn` or `npm` in lieu of `jlpm` below. - -```bash -# Clone the repo to your local environment -# Change directory to the lc_multi_outputs directory -# Install package in development mode -pip install -e "." -# Link your development version of the extension with JupyterLab -jupyter labextension develop . --overwrite -# Rebuild extension Typescript source after making changes -jlpm build -``` - -You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension. - -```bash -# Watch the source directory in one terminal, automatically rebuilding when needed -jlpm watch -# Run JupyterLab in another terminal -jupyter lab -``` - -With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt). - -By default, the `jlpm build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command: - -```bash -jupyter lab build --minimize=False -``` - -### Development uninstall - -```bash -pip uninstall lc_multi_outputs -``` - -In development mode, you will also need to remove the symlink created by `jupyter labextension develop` -command. To find its location, you can run `jupyter labextension list` to figure out where the `labextensions` -folder is located. Then you can remove the symlink named `lc_multi_outputs` within that folder. - -### Packaging the extension - -See [RELEASE](RELEASE.md) diff --git a/_temp_extension/RELEASE.md b/_temp_extension/RELEASE.md deleted file mode 100644 index 13c364b..0000000 --- a/_temp_extension/RELEASE.md +++ /dev/null @@ -1,111 +0,0 @@ -# Making a new release of lc_multi_outputs - -The extension can be published to `PyPI` and `npm` manually or using the [Jupyter Releaser](https://github.com/jupyter-server/jupyter_releaser). - -## Manual release - -### Python package - -This extension can be distributed as Python packages. All of the Python -packaging instructions are in the `pyproject.toml` file to wrap your extension in a -Python package. Before generating a package, you first need to install some tools: - -```bash -pip install build twine hatch -``` - -Bump the version using `hatch`. By default this will create a tag. -See the docs on [hatch-nodejs-version](https://github.com/agoose77/hatch-nodejs-version#semver) for details. - -```bash -hatch version -``` - -Make sure to clean up all the development files before building the package: - -```bash -jlpm clean:all -``` - -You could also clean up the local git repository: - -```bash -git clean -dfX -``` - -To create a Python source package (`.tar.gz`) and the binary package (`.whl`) in the `dist/` directory, do: - -```bash -python -m build -``` - -> `python setup.py sdist bdist_wheel` is deprecated and will not work for this package. - -Then to upload the package to PyPI, do: - -```bash -twine upload dist/* -``` - -### NPM package - -To publish the frontend part of the extension as a NPM package, do: - -```bash -npm login -npm publish --access public -``` - -## Automated releases with the Jupyter Releaser - -The extension repository should already be compatible with the Jupyter Releaser. - -Check out the [workflow documentation](https://jupyter-releaser.readthedocs.io/en/latest/get_started/making_release_from_repo.html) for more information. - -Here is a summary of the steps to cut a new release: - -- Add tokens to the [Github Secrets](https://docs.github.com/en/actions/security-guides/encrypted-secrets) in the repository: - - `ADMIN_GITHUB_TOKEN` (with "public_repo" and "repo:status" permissions); see the [documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token) - - `NPM_TOKEN` (with "automation" permission); see the [documentation](https://docs.npmjs.com/creating-and-viewing-access-tokens) -- Set up PyPI - -
Using PyPI trusted publisher (modern way) - -- Set up your PyPI project by [adding a trusted publisher](https://docs.pypi.org/trusted-publishers/adding-a-publisher/) - - The _workflow name_ is `publish-release.yml` and the _environment_ should be left blank. -- Ensure the publish release job as `permissions`: `id-token : write` (see the [documentation](https://docs.pypi.org/trusted-publishers/using-a-publisher/)) - -
- -
Using PyPI token (legacy way) - -- If the repo generates PyPI release(s), create a scoped PyPI [token](https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/#saving-credentials-on-github). We recommend using a scoped token for security reasons. - -- You can store the token as `PYPI_TOKEN` in your fork's `Secrets`. - - - Advanced usage: if you are releasing multiple repos, you can create a secret named `PYPI_TOKEN_MAP` instead of `PYPI_TOKEN` that is formatted as follows: - - ```text - owner1/repo1,token1 - owner2/repo2,token2 - ``` - - If you have multiple Python packages in the same repository, you can point to them as follows: - - ```text - owner1/repo1/path/to/package1,token1 - owner1/repo1/path/to/package2,token2 - ``` - -
- -- Go to the Actions panel -- Run the "Step 1: Prep Release" workflow -- Check the draft changelog -- Run the "Step 2: Publish Release" workflow - -## Publishing to `conda-forge` - -If the package is not on conda forge yet, check the documentation to learn how to add it: https://conda-forge.org/docs/maintainer/adding_pkgs.html - -Otherwise a bot should pick up the new version publish to PyPI, and open a new PR on the feedstock repository automatically. diff --git a/_temp_extension/binder/environment.yml b/_temp_extension/binder/environment.yml deleted file mode 100644 index c9c4b2c..0000000 --- a/_temp_extension/binder/environment.yml +++ /dev/null @@ -1,21 +0,0 @@ -# a mybinder.org-ready environment for demoing lc_multi_outputs -# this environment may also be used locally on Linux/MacOS/Windows, e.g. -# -# conda env update --file binder/environment.yml -# conda activate lc-multi-outputs-demo -# -name: lc-multi-outputs-demo - -channels: - - conda-forge - -dependencies: - # runtime dependencies - - python >=3.10,<3.11.0a0 - - jupyterlab >=4.0.0,<5 - # labextension build dependencies - - nodejs >=18,<19 - - pip - - wheel - # additional packages for demos - # - ipywidgets diff --git a/_temp_extension/binder/postBuild b/_temp_extension/binder/postBuild deleted file mode 100755 index 5dde3cf..0000000 --- a/_temp_extension/binder/postBuild +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 -""" perform a development install of lc_multi_outputs - - On Binder, this will run _after_ the environment has been fully created from - the environment.yml in this directory. - - This script should also run locally on Linux/MacOS/Windows: - - python3 binder/postBuild -""" -import subprocess -import sys -from pathlib import Path - - -ROOT = Path.cwd() - -def _(*args, **kwargs): - """ Run a command, echoing the args - - fails hard if something goes wrong - """ - print("\n\t", " ".join(args), "\n") - return_code = subprocess.call(args, **kwargs) - if return_code != 0: - print("\nERROR", return_code, " ".join(args)) - sys.exit(return_code) - -# verify the environment is self-consistent before even starting -_(sys.executable, "-m", "pip", "check") - -# install the labextension -_(sys.executable, "-m", "pip", "install", "-e", ".") -_(sys.executable, "-m", "jupyter", "labextension", "develop", "--overwrite", ".") - -# verify the environment the extension didn't break anything -_(sys.executable, "-m", "pip", "check") - -# list the extensions -_("jupyter", "server", "extension", "list") - -# initially list installed extensions to determine if there are any surprises -_("jupyter", "labextension", "list") - - -print("JupyterLab with lc_multi_outputs is ready to run with:\n") -print("\tjupyter lab\n") diff --git a/_temp_extension/install.json b/_temp_extension/install.json deleted file mode 100644 index 33b734d..0000000 --- a/_temp_extension/install.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "packageManager": "python", - "packageName": "lc_multi_outputs", - "uninstallInstructions": "Use your Python package manager (pip, conda, etc.) to uninstall the package lc_multi_outputs" -} diff --git a/_temp_extension/lc_multi_outputs/__init__.py b/_temp_extension/lc_multi_outputs/__init__.py deleted file mode 100644 index 9795bb7..0000000 --- a/_temp_extension/lc_multi_outputs/__init__.py +++ /dev/null @@ -1,16 +0,0 @@ -try: - from ._version import __version__ -except ImportError: - # Fallback when using the package in dev mode without installing - # in editable mode with pip. It is highly recommended to install - # the package from a stable release or in editable mode: https://pip.pypa.io/en/stable/topics/local-project-installs/#editable-installs - import warnings - warnings.warn("Importing 'lc_multi_outputs' outside a proper installation.") - __version__ = "dev" - - -def _jupyter_labextension_paths(): - return [{ - "src": "labextension", - "dest": "lc_multi_outputs" - }] diff --git a/_temp_extension/package.json b/_temp_extension/package.json deleted file mode 100644 index 4384368..0000000 --- a/_temp_extension/package.json +++ /dev/null @@ -1,182 +0,0 @@ -{ - "name": "lc_multi_outputs", - "version": "0.1.0", - "description": "Multiple outputs as tabs", - "keywords": [ - "jupyter", - "jupyterlab", - "jupyterlab-extension" - ], - "homepage": "https://github.com/entap/lc_multi_outputs.git", - "bugs": { - "url": "https://github.com/entap/lc_multi_outputs.git/issues" - }, - "license": "BSD-3-Clause", - "author": { - "name": "ii masamitsu", - "email": "ii@entap.co.jp" - }, - "files": [ - "lib/**/*.{d.ts,eot,gif,html,jpg,js,js.map,json,png,svg,woff2,ttf}", - "style/**/*.{css,js,eot,gif,html,jpg,json,png,svg,woff2,ttf}", - "schema/*.json" - ], - "main": "lib/index.js", - "types": "lib/index.d.ts", - "style": "style/index.css", - "repository": { - "type": "git", - "url": "https://github.com/entap/lc_multi_outputs.git.git" - }, - "scripts": { - "build": "jlpm build:lib && jlpm build:labextension:dev", - "build:prod": "jlpm clean && jlpm build:lib:prod && jlpm build:labextension", - "build:labextension": "jupyter labextension build .", - "build:labextension:dev": "jupyter labextension build --development True .", - "build:lib": "tsc --sourceMap", - "build:lib:prod": "tsc", - "clean": "jlpm clean:lib", - "clean:lib": "rimraf lib tsconfig.tsbuildinfo", - "clean:lintcache": "rimraf .eslintcache .stylelintcache", - "clean:labextension": "rimraf lc_multi_outputs/labextension lc_multi_outputs/_version.py", - "clean:all": "jlpm clean:lib && jlpm clean:labextension && jlpm clean:lintcache", - "eslint": "jlpm eslint:check --fix", - "eslint:check": "eslint . --cache --ext .ts,.tsx", - "install:extension": "jlpm build", - "lint": "jlpm stylelint && jlpm prettier && jlpm eslint", - "lint:check": "jlpm stylelint:check && jlpm prettier:check && jlpm eslint:check", - "prettier": "jlpm prettier:base --write --list-different", - "prettier:base": "prettier \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md}\"", - "prettier:check": "jlpm prettier:base --check", - "stylelint": "jlpm stylelint:check --fix", - "stylelint:check": "stylelint --cache \"style/**/*.css\"", - "watch": "run-p watch:src watch:labextension", - "watch:src": "tsc -w --sourceMap", - "watch:labextension": "jupyter labextension watch ." - }, - "dependencies": { - "@jupyterlab/application": "^4.0.0", - "@jupyterlab/settingregistry": "^4.0.0" - }, - "devDependencies": { - "@jupyterlab/builder": "^4.0.0", - "@types/json-schema": "^7.0.11", - "@types/react": "^18.0.26", - "@typescript-eslint/eslint-plugin": "^6.1.0", - "@typescript-eslint/parser": "^6.1.0", - "css-loader": "^6.7.1", - "eslint": "^8.36.0", - "eslint-config-prettier": "^8.8.0", - "eslint-plugin-prettier": "^5.0.0", - "npm-run-all": "^4.1.5", - "prettier": "^3.0.0", - "rimraf": "^5.0.1", - "source-map-loader": "^1.0.2", - "style-loader": "^3.3.1", - "stylelint": "^15.10.1", - "stylelint-config-recommended": "^13.0.0", - "stylelint-config-standard": "^34.0.0", - "stylelint-prettier": "^4.0.0", - "typescript": "~5.0.2", - "yjs": "^13.5.0" - }, - "sideEffects": [ - "style/*.css", - "style/index.js" - ], - "styleModule": "style/index.js", - "publishConfig": { - "access": "public" - }, - "jupyterlab": { - "extension": true, - "outputDir": "lc_multi_outputs/labextension", - "schemaDir": "schema" - }, - "eslintIgnore": [ - "node_modules", - "dist", - "coverage", - "**/*.d.ts" - ], - "eslintConfig": { - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "plugin:prettier/recommended" - ], - "parser": "@typescript-eslint/parser", - "parserOptions": { - "project": "tsconfig.json", - "sourceType": "module" - }, - "plugins": [ - "@typescript-eslint" - ], - "rules": { - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "interface", - "format": [ - "PascalCase" - ], - "custom": { - "regex": "^I[A-Z]", - "match": true - } - } - ], - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "args": "none" - } - ], - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-namespace": "off", - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/quotes": [ - "error", - "single", - { - "avoidEscape": true, - "allowTemplateLiterals": false - } - ], - "curly": [ - "error", - "all" - ], - "eqeqeq": "error", - "prefer-arrow-callback": "error" - } - }, - "prettier": { - "singleQuote": true, - "trailingComma": "none", - "arrowParens": "avoid", - "endOfLine": "auto", - "overrides": [ - { - "files": "package.json", - "options": { - "tabWidth": 4 - } - } - ] - }, - "stylelint": { - "extends": [ - "stylelint-config-recommended", - "stylelint-config-standard", - "stylelint-prettier/recommended" - ], - "rules": { - "property-no-vendor-prefix": null, - "selector-no-vendor-prefix": null, - "value-no-vendor-prefix": null - } - } -} diff --git a/_temp_extension/pyproject.toml b/_temp_extension/pyproject.toml deleted file mode 100644 index 26185ab..0000000 --- a/_temp_extension/pyproject.toml +++ /dev/null @@ -1,76 +0,0 @@ -[build-system] -requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version"] -build-backend = "hatchling.build" - -[project] -name = "lc_multi_outputs" -readme = "README.md" -license = { file = "LICENSE" } -requires-python = ">=3.8" -classifiers = [ - "Framework :: Jupyter", - "Framework :: Jupyter :: JupyterLab", - "Framework :: Jupyter :: JupyterLab :: 4", - "Framework :: Jupyter :: JupyterLab :: Extensions", - "Framework :: Jupyter :: JupyterLab :: Extensions :: Prebuilt", - "License :: OSI Approved :: BSD License", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", -] -dependencies = [ -] -dynamic = ["version", "description", "authors", "urls", "keywords"] - -[tool.hatch.version] -source = "nodejs" - -[tool.hatch.metadata.hooks.nodejs] -fields = ["description", "authors", "urls"] - -[tool.hatch.build.targets.sdist] -artifacts = ["lc_multi_outputs/labextension"] -exclude = [".github", "binder"] - -[tool.hatch.build.targets.wheel.shared-data] -"lc_multi_outputs/labextension" = "share/jupyter/labextensions/lc_multi_outputs" -"install.json" = "share/jupyter/labextensions/lc_multi_outputs/install.json" - -[tool.hatch.build.hooks.version] -path = "lc_multi_outputs/_version.py" - -[tool.hatch.build.hooks.jupyter-builder] -dependencies = ["hatch-jupyter-builder>=0.5"] -build-function = "hatch_jupyter_builder.npm_builder" -ensured-targets = [ - "lc_multi_outputs/labextension/static/style.js", - "lc_multi_outputs/labextension/package.json", -] -skip-if-exists = ["lc_multi_outputs/labextension/static/style.js"] - -[tool.hatch.build.hooks.jupyter-builder.build-kwargs] -build_cmd = "build:prod" -npm = ["jlpm"] - -[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs] -build_cmd = "install:extension" -npm = ["jlpm"] -source_dir = "src" -build_dir = "lc_multi_outputs/labextension" - -[tool.jupyter-releaser.options] -version_cmd = "hatch version" - -[tool.jupyter-releaser.hooks] -before-build-npm = [ - "python -m pip install 'jupyterlab>=4.0.0,<5'", - "jlpm", - "jlpm build:prod" -] -before-build-python = ["jlpm clean:all"] - -[tool.check-wheel-contents] -ignore = ["W002"] diff --git a/_temp_extension/schema/plugin.json b/_temp_extension/schema/plugin.json deleted file mode 100644 index 3fd0179..0000000 --- a/_temp_extension/schema/plugin.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "jupyter.lab.shortcuts": [], - "title": "lc_multi_outputs", - "description": "lc_multi_outputs settings.", - "type": "object", - "properties": {}, - "additionalProperties": false -} diff --git a/_temp_extension/setup.py b/_temp_extension/setup.py deleted file mode 100644 index aefdf20..0000000 --- a/_temp_extension/setup.py +++ /dev/null @@ -1 +0,0 @@ -__import__("setuptools").setup() diff --git a/_temp_extension/src/index.ts b/_temp_extension/src/index.ts deleted file mode 100644 index 522b5c4..0000000 --- a/_temp_extension/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { - JupyterFrontEnd, - JupyterFrontEndPlugin -} from '@jupyterlab/application'; - -import { ISettingRegistry } from '@jupyterlab/settingregistry'; - -/** - * Initialization data for the lc_multi_outputs extension. - */ -const plugin: JupyterFrontEndPlugin = { - id: 'lc_multi_outputs:plugin', - description: 'Multiple outputs as tabs', - autoStart: true, - optional: [ISettingRegistry], - activate: (app: JupyterFrontEnd, settingRegistry: ISettingRegistry | null) => { - console.log('JupyterLab extension lc_multi_outputs is activated!'); - - if (settingRegistry) { - settingRegistry - .load(plugin.id) - .then(settings => { - console.log('lc_multi_outputs settings loaded:', settings.composite); - }) - .catch(reason => { - console.error('Failed to load settings for lc_multi_outputs.', reason); - }); - } - } -}; - -export default plugin; diff --git a/_temp_extension/style/base.css b/_temp_extension/style/base.css deleted file mode 100644 index e11f457..0000000 --- a/_temp_extension/style/base.css +++ /dev/null @@ -1,5 +0,0 @@ -/* - See the JupyterLab Developer Guide for useful CSS Patterns: - - https://jupyterlab.readthedocs.io/en/stable/developer/css.html -*/ diff --git a/_temp_extension/style/index.css b/_temp_extension/style/index.css deleted file mode 100644 index 8a7ea29..0000000 --- a/_temp_extension/style/index.css +++ /dev/null @@ -1 +0,0 @@ -@import url('base.css'); diff --git a/_temp_extension/style/index.js b/_temp_extension/style/index.js deleted file mode 100644 index a028a76..0000000 --- a/_temp_extension/style/index.js +++ /dev/null @@ -1 +0,0 @@ -import './base.css'; diff --git a/_temp_extension/tsconfig.json b/_temp_extension/tsconfig.json deleted file mode 100644 index 9897917..0000000 --- a/_temp_extension/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "compilerOptions": { - "allowSyntheticDefaultImports": true, - "composite": true, - "declaration": true, - "esModuleInterop": true, - "incremental": true, - "jsx": "react", - "module": "esnext", - "moduleResolution": "node", - "noEmitOnError": true, - "noImplicitAny": true, - "noUnusedLocals": true, - "preserveWatchOutput": true, - "resolveJsonModule": true, - "outDir": "lib", - "rootDir": "src", - "strict": true, - "strictNullChecks": true, - "target": "ES2018" - }, - "include": ["src/*"] -} diff --git a/binder/environment.yml b/binder/environment.yml deleted file mode 100644 index 0b1161d..0000000 --- a/binder/environment.yml +++ /dev/null @@ -1,21 +0,0 @@ -# a mybinder.org-ready environment for demoing lc_multi_outputs -# this environment may also be used locally on Linux/MacOS/Windows, e.g. -# -# conda env update --file binder/environment.yml -# conda activate lc-multi-outputs-demo -# -name: lc-multi-outputs-demo - -channels: - - conda-forge - -dependencies: - # runtime dependencies - - python >=3.8,<3.9.0a0 - - jupyterlab >=3,<4.0.0a0 - # labextension build dependencies - - nodejs >=14,<15 - - pip - - wheel - # additional packages for demos - # - ipywidgets diff --git a/binder/postBuild b/binder/postBuild deleted file mode 100755 index 5dde3cf..0000000 --- a/binder/postBuild +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python3 -""" perform a development install of lc_multi_outputs - - On Binder, this will run _after_ the environment has been fully created from - the environment.yml in this directory. - - This script should also run locally on Linux/MacOS/Windows: - - python3 binder/postBuild -""" -import subprocess -import sys -from pathlib import Path - - -ROOT = Path.cwd() - -def _(*args, **kwargs): - """ Run a command, echoing the args - - fails hard if something goes wrong - """ - print("\n\t", " ".join(args), "\n") - return_code = subprocess.call(args, **kwargs) - if return_code != 0: - print("\nERROR", return_code, " ".join(args)) - sys.exit(return_code) - -# verify the environment is self-consistent before even starting -_(sys.executable, "-m", "pip", "check") - -# install the labextension -_(sys.executable, "-m", "pip", "install", "-e", ".") -_(sys.executable, "-m", "jupyter", "labextension", "develop", "--overwrite", ".") - -# verify the environment the extension didn't break anything -_(sys.executable, "-m", "pip", "check") - -# list the extensions -_("jupyter", "server", "extension", "list") - -# initially list installed extensions to determine if there are any surprises -_("jupyter", "labextension", "list") - - -print("JupyterLab with lc_multi_outputs is ready to run with:\n") -print("\tjupyter lab\n") diff --git a/package.json b/package.json index 88da4d2..8ede540 100644 --- a/package.json +++ b/package.json @@ -7,9 +7,9 @@ "jupyterlab", "jupyterlab-extension" ], - "homepage": "https://github.com/entap/lc_multi_outputs", + "homepage": "https://github.com/NII-cloud-operation/Jupyter-multi_outputs", "bugs": { - "url": "https://github.com/entap/lc_multi_outputs/issues" + "url": "https://github.com/NII-cloud-operation/Jupyter-multi_outputs/issues" }, "license": "BSD-3-Clause", "author": { @@ -28,7 +28,7 @@ "style": "style/index.css", "repository": { "type": "git", - "url": "https://github.com/entap/lc_multi_outputs.git" + "url": "https://github.com/NII-cloud-operation/Jupyter-multi_outputs.git" }, "workspaces": [ "ui-tests"