Skip to content

Commit

Permalink
Merge pull request #23 from yacchin1205/fix/npm-error
Browse files Browse the repository at this point in the history
Fix build script for latest JupyterLab
  • Loading branch information
yacchin1205 authored Nov 12, 2024
2 parents 87c7749 + f37e3e0 commit bd76654
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 72 deletions.
38 changes: 34 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,59 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Install dependencies
run: python -m pip install -U 'jupyterlab>=4.0.0,<5'
run: python -m pip install -U 'jupyterlab>=4.0.0,<5' && python -m pip install -U 'notebook>=7,<8'

- name: Build the extension
run: |
set -eux
jlpm
jlpm lint:check
jlpm run eslint:check
cd ./components
npm install
npm run build
cd ..
cd ./nbextension
npm install
npm run build
cd ..
python -m pip install .
jupyter labextension list 2>&1 | grep -ie "lc_notebook_diff.*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 "lc_notebook_diff" jupyterlab
rm -rf myextension
- uses: actions/upload-artifact@v2
npm pack
mv lc_notebook_diff-*.tgz myextension-nodejs.tgz
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: ui-tests/playwright-report/
retention-days: 30

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

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

test_isolated:
needs: build
runs-on: ubuntu-latest
Expand All @@ -52,7 +82,7 @@ jobs:
with:
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: myextension-sdist
- name: Install and Test
Expand Down
63 changes: 0 additions & 63 deletions .github/workflows/check-release.yml

This file was deleted.

15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,19 @@ jobs:
npm pack
mv lc_notebook_diff-*.tgz myextension-nodejs.tgz
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: ui-tests/playwright-report/
retention-days: 30

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

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
with:
name: myextension-nodejs
path: myextension-nodejs.tgz
Expand All @@ -96,10 +103,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: myextension-sdist
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v4
with:
name: myextension-nodejs
- name: release
Expand Down
2 changes: 1 addition & 1 deletion hatch_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ class CustomHook(BuildHookInterface):

def initialize(self, version, build_data):
"""Initialize the hook."""
if self.target_name not in ["wheel", "sdist"]:
if self.target_name not in ["sdist"]:
return
build_nbextension()

0 comments on commit bd76654

Please sign in to comment.