Skip to content

Commit

Permalink
Update to JupyterLab 4
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Aug 9, 2023
1 parent b1ecc2c commit bbbc392
Show file tree
Hide file tree
Showing 20 changed files with 507 additions and 357 deletions.
14 changes: 14 additions & 0 deletions .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v4.1.0
_src_path: https://github.com/jupyterlab/extension-template
author_email: ''
author_name: ipylab contributors
has_binder: false
has_settings: false
kind: frontend
labextension_name: ipylab
project_short_description: Control JupyterLab from Python notebooks
python_name: ipylab
repository: https://github.com/jtpio/ipylab
test: false

5 changes: 0 additions & 5 deletions .eslintignore

This file was deleted.

39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

80 changes: 69 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,87 @@ name: Build

on:
push:
branches: [ main ]
branches: main
pull_request:
branches:
- '*'
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: |
python -m pip install --upgrade pip jupyterlab~=3.0
- name: Install the ipylab Python package and JupyterLab extension
run: |
python -m pip install .
jupyter labextension list 2>&1 | grep -ie "ipylab.*enabled.*ok" -
- name: Browser check
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 "ipylab.*OK"
python -m jupyterlab.browser_check
- name: Check ipylab can be imported
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "ipylab" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v3
with:
name: extension-artifacts
path: dist/ipylab*
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: |
python -c "from ipylab import JupyterFrontEnd"
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" ipylab*.whl
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "ipylab.*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
16 changes: 6 additions & 10 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
name: Check Release
on:
push:
branches:
- main
branches: ["main"]
pull_request:
branches:
- main

permissions:
contents: write
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 }}
version_spec: next

- name: Upload Distributions
uses: actions/upload-artifact@v3
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
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
1 change: 0 additions & 1 deletion .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
version_spec: ${{ github.event.inputs.version_spec }}
post_version_spec: ${{ github.event.inputs.post_version_spec }}
target: ${{ github.event.inputs.target }}
branch: ${{ github.event.inputs.branch }}
since: ${{ github.event.inputs.since }}
since_last_stable: ${{ github.event.inputs.since_last_stable }}
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ on:
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

Expand All @@ -23,22 +27,21 @@ jobs:
uses: jupyter-server/jupyter_releaser/.github/actions/populate-release@v2
with:
token: ${{ secrets.ADMIN_GITHUB_TOKEN }}
target: ${{ github.event.inputs.target }}
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:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
PYPI_TOKEN_MAP: ${{ secrets.PYPI_TOKEN_MAP }}
TWINE_USERNAME: __token__
# 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 }}
target: ${{ github.event.inputs.target }}
release_url: ${{ steps.populate-release.outputs.release_url }}

- name: "** Next Step **"
Expand Down
Loading

0 comments on commit bbbc392

Please sign in to comment.