Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Notebook 7 support #23

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1065449
Fix jupyter-lab script
yacchin1205 May 16, 2023
cff43c8
Fix listdir for PermissionError
yacchin1205 May 16, 2023
b54d58f
Fix notebook permission for nbsearch-tmp
yacchin1205 May 16, 2023
5bd2147
Add tooltip for server column
yacchin1205 May 16, 2023
b909753
Merge pull request #17 from yacchin1205/fix/mybinder
yacchin1205 May 16, 2023
1cc05e6
Merge pull request #18 from yacchin1205/fix/no-permission-directory
yacchin1205 May 16, 2023
53eabac
Merge pull request #19 from yacchin1205/fix/tmp-read-permission
yacchin1205 May 16, 2023
48219b0
Fix binder URL
yacchin1205 May 16, 2023
e3beeab
Fix base handler for jupyter_server
yacchin1205 May 30, 2023
6262ec6
Fix whitespaces
yacchin1205 May 30, 2023
f1952d6
Fix dependencies
yacchin1205 May 31, 2023
747e814
Merge pull request #20 from yacchin1205/fix/jupyter-server-handler
yacchin1205 May 31, 2023
cf241d6
Fix base directory
yacchin1205 Jul 4, 2023
f8fb43a
Merge pull request #21 from yacchin1205/fix/base-dir
yacchin1205 Jul 5, 2023
85c19de
Add jupyterlab extension
yacchin1205 Oct 3, 2023
6592734
Fix to install Jupyter Notebook 7
yacchin1205 Oct 3, 2023
249ddab
Fix workflows for test
yacchin1205 Dec 27, 2023
adfc971
Bump the version
yacchin1205 Dec 27, 2023
7a3ff01
Fix lints
yacchin1205 Dec 27, 2023
5e526c3
Fix pyproject
yacchin1205 Dec 27, 2023
2c0acdc
Add cell search
yacchin1205 Apr 19, 2024
9fe1a90
Improve display style
yacchin1205 Apr 20, 2024
31cf0f7
Fix lazy handling for Search Query
yacchin1205 Apr 23, 2024
d1a6da8
Fix tests
yacchin1205 Apr 23, 2024
54dd75c
Fix missing cell index
yacchin1205 Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v4.2.1
_src_path: https://github.com/jupyterlab/extension-template
author_email: ''
author_name: National Institute of Informatics.
data_format: string
file_extension: ''
has_binder: true
has_settings: true
kind: frontend
labextension_name: nbsearch
mimetype: ''
mimetype_name: ''
project_short_description: NBSearch Jupyter Extension
python_name: nbsearch
repository: https://github.com/NII-cloud-operation/nbsearch/
test: true
viewer_name: ''

31 changes: 31 additions & 0 deletions .github/workflows/binder-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html
name: Binder Badge
on:
pull_request_target:
types: [opened]

permissions:
pull-requests: write


jobs:
binder:
runs-on: ubuntu-latest
steps:
- name: comment on PR with Binder link
uses: actions/github-script@v3
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO;
var PR_HEAD_REF = process.env.PR_HEAD_REF;
github.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=lab) :point_left: Launch a Binder on branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_`
})
env:
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }}

67 changes: 67 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build

on:
push:
branches: main
pull_request:
branches: '*'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- 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: Build the extension
run: |
set -eux
jlpm
jlpm lint:check
python -m pip install .

jupyter labextension list 2>&1 | grep -ie "nbsearch.*OK"
python -m jupyterlab.browser_check

pip install build
python -m build --sdist
cp dist/*.tar.gz myextension.tar.gz
pip uninstall -y "nbsearch" jupyterlab
rm -rf myextension

- uses: actions/upload-artifact@v2
with:
name: myextension-sdist
path: myextension.tar.gz

test_isolated:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v2
with:
name: myextension-sdist
- 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 myextension.tar.gz
pip install jupyterlab
jupyter labextension list 2>&1 | grep -ie "nbsearch.*OK"
python -m jupyterlab.browser_check --no-chrome-test
63 changes: 63 additions & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Check Release
on:
push:
branches:
- main
pull_request:
branches:
- main

permissions:
contents: write

jobs:
check_release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: 'x64'
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18


- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache pip
uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('package.json') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache checked links
uses: actions/cache@v2
with:
path: ~/.cache/pytest-link-check
key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links
restore-keys: |
${{ runner.os }}-linkcheck-
- name: Upgrade packaging dependencies
run: |
pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user
- name: Install Dependencies
run: |
pip install .
- name: Check Release
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Distributions
uses: actions/upload-artifact@v2
with:
name: nbsearch-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
125 changes: 125 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Release

on:
workflow_dispatch:
push:
tags: ['*']

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'


- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-3.9-${{ hashFiles('package.json') }}
restore-keys: |
pip-3.9-
pip-

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v2
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-

- name: Install dependencies
run: python -m pip install -U 'jupyterlab>=4.0.0,<5'
- name: Build the extension
run: |
set -eux
jlpm
jlpm run eslint:check
python -m pip install .

jupyter labextension list 2>&1 | grep -ie "nbsearch.*OK"
python -m jupyterlab.browser_check

jlpm install
cd ./ui-tests
jlpm install
jlpm playwright install
jlpm playwright test
cd ..

pip install build
python -m build --sdist
cp dist/*.tar.gz myextension.tar.gz
pip uninstall -y myextension jupyterlab
rm -rf myextension

npm pack
mv nbsearch-*.tgz myextension-nodejs.tgz

- uses: actions/upload-artifact@v2
with:
name: myextension-sdist
path: myextension.tar.gz

- uses: actions/upload-artifact@v2
with:
name: myextension-nodejs
path: myextension-nodejs.tgz

draft_release:
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: myextension-sdist
- uses: actions/download-artifact@v2
with:
name: myextension-nodejs
- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: true
prerelease: false
release_name: ${{ github.ref }}
tag_name: ${{ github.ref }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload pip package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: myextension.tar.gz
asset_name: nbsearch-${{ github.ref_name }}.tar.gz
asset_content_type: application/gzip
- name: upload nodejs package
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: myextension-nodejs.tgz
asset_name: nbsearch-${{ github.ref_name }}.tgz
asset_content_type: application/gzip
Loading