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

Upgrade to JupyterLab 4.0 #65

Merged
merged 10 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 0 additions & 6 deletions .eslintignore

This file was deleted.

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

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ https://jupyterlab.readthedocs.io/en/latest/getting_started/issue.html

<!--Complete the following for context, and add any other relevant context-->

- Operating System and version:
- Browser and version:
- JupyterLab version:
- Operating System and version:
- Browser and version:
- JupyterLab version:

<details><summary>Required: installed server extensions</summary>
<pre>
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/binder-on-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
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 }}
238 changes: 100 additions & 138 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,182 +8,144 @@ on:

jobs:
build:
name: Build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'


- name: Setup pip cache
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: pip-3.8-${{ hashFiles('package.json') }}
restore-keys: |
pip-3.8-
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-
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~=3.0 check-manifest
- name: Install extension
run: python -m pip install -U "jupyterlab>=4.0.0,<5"

- name: Lint the extension
run: |
set -eux
jlpm
python -m pip install .
jupyter labextension list 2>&1 | grep -ie "jupyterlab-citation-manager.*OK"
jlpm run lint:check

- name: Run browser check test
- name: Build the extension
run: |
set -eux
python -m jupyterlab.browser_check
python -m pip install .[test]

- name: Check style
run: |
set -eux
jlpm run eslint:check
pytest -vv -r ap --cov jupyterlab_citation_manager
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "jupyterlab_citation_manager.*OK"

- name: Build the extension
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-citation-manager.*OK"
python -m jupyterlab.browser_check

- name: Package the extension
run: |
set -eux
check-manifest -v

pip install build
python -m build --sdist
cp dist/*.tar.gz extension.tar.gz
pip uninstall -y extension jupyterlab
rm -rf extension
- uses: actions/upload-artifact@v2
python -m build
pip uninstall -y "jupyterlab_citation_manager" jupyterlab

- name: Upload extension packages
uses: actions/upload-artifact@v3
with:
name: extension-sdist
path: extension.tar.gz
name: extension-artifacts
path: dist/jupyterlab_citation_manager*
if-no-files-found: error

test_isolated:
name: Test in isolated environment
needs: build
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: '3.8'
python-version: '3.9'
architecture: 'x64'
- uses: actions/download-artifact@v2
- uses: actions/download-artifact@v3
with:
name: extension-sdist
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 extension.tar.gz
pip install jupyterlab

pip install "jupyterlab>=4.0.0,<5" jupyterlab_citation_manager*.whl


jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "jupyterlab_citation_manager.*OK"

jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "jupyterlab-citation-manager.*OK"
python -m jupyterlab.browser_check --no-chrome-test
python -m jupyterlab.browser_check --no-browser-test

test_python:
name: Run Python tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: 'x64'
- name: Install testing dependencies
run: python -m pip install pytest jupyter_server
- name: Copy package.json
run: |
mkdir jupyterlab_citation_manager/labextension
cp package.json jupyterlab_citation_manager/labextension/
- name: Run Python tests
run: |
set -eux
python3 -m pytest

ui-test:
integration-tests:
name: Integration tests
needs: build
runs-on: ubuntu-latest

needs: build
env:
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Download extension package
uses: actions/download-artifact@v3
with:
name: extension-artifacts

- name: Install the extension
run: |
set -eux
python -m pip install "jupyterlab>=4.0.0,<5" jupyterlab_citation_manager*.whl

- name: Install dependencies
working-directory: ui-tests
env:
YARN_ENABLE_IMMUTABLE_INSTALLS: 0
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Set up browser cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/pw-browsers
key: ${{ runner.os }}-${{ hashFiles('ui-tests/yarn.lock') }}

- name: Install browser
run: jlpm playwright install chromium
working-directory: ui-tests

- name: Execute integration tests
working-directory: ui-tests
run: |
jlpm playwright test

- name: Upload Playwright Test report
if: always()
uses: actions/upload-artifact@v3
with:
name: jupyterlab_citation_manager-playwright-tests
path: |
ui-tests/test-results
ui-tests/playwright-report

check_links:
name: Check Links
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install node
uses: actions/setup-node@v1
with:
node-version: '14.x'
- uses: actions/download-artifact@v2
with:
name: extension-sdist
- name: Setup Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
architecture: 'x64'

- name: Install dependencies
run: |
pip install extension.tar.gz
pip install jupyterlab~=3.0

- name: Prepare for UI tests
run: |
jlpm
jlpm install:browser
jlpm start-jlab:detached
working-directory: ui-tests

- name: Wait for JupyterLab
uses: ifaxity/wait-on-action@31409304f67f28ae9559d3646ac9b59f78c6f0ba
with:
resource: http-get://localhost:8888/lab
timeout: 360000

- name: Run UI tests
run: |
jlpm run test
working-directory: ui-tests

- name: Upload UI Test artifacts
if: always()
uses: actions/upload-artifact@v2
with:
name: ui-test-output
path: |
ui-tests/playwright-report
ui-tests/test-results

- name: Stop JupyterLab
if: always()
run: |
killall jupyter-lab
working-directory: ui-tests
- uses: actions/checkout@v3
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1
26 changes: 26 additions & 0 deletions .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
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: 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: jupyterlab_citation_manager-releaser-dist-${{ github.run_number }}
path: .jupyter_releaser_checkout/dist
13 changes: 13 additions & 0 deletions .github/workflows/enforce-label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
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
Loading
Loading