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

Add extension for Jupyter Notebook 7 #425

Merged
merged 28 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
3f54ff7
start nb7 support
bollwyvl Sep 19, 2023
ae32a68
update test infrastructure
bollwyvl Sep 20, 2023
b7d3378
linting
bollwyvl Sep 20, 2023
7f5b351
more test work
bollwyvl Sep 20, 2023
4b8a889
fix artifact names
bollwyvl Sep 20, 2023
1842173
update with review comments
bollwyvl Sep 20, 2023
bc59fda
reduce more log noise
bollwyvl Sep 20, 2023
6219137
use session scope for utest performance, increase atest timeouts
bollwyvl Sep 20, 2023
6d13e74
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 20, 2023
a4887b4
emulate classic ui in notebook 7
bollwyvl Sep 20, 2023
64d4eec
fix notebook 7 test
bollwyvl Sep 20, 2023
cd3d900
update typescript comments, imports
bollwyvl Sep 21, 2023
af5bbb0
increase launcher wait time
bollwyvl Sep 21, 2023
c1fcdd0
ci: remove redundant shell specification
consideRatio Sep 21, 2023
6a1370b
ci: refactor without changing test matrix
consideRatio Sep 21, 2023
46ffda4
ci: check all server and frontent extension status
consideRatio Sep 21, 2023
70a6fbb
ci: let publish workflow use node v20 like in test workflow
consideRatio Sep 21, 2023
d1f2705
Remove no longer needed workaround for acceptance test dependencies
consideRatio Sep 21, 2023
f503dde
ci: reduce complexity of invoking pytest
consideRatio Sep 21, 2023
176c9f0
Revert "ci: reduce complexity of invoking pytest"
consideRatio Sep 21, 2023
5b13c20
ci: add pytest testpath config and comment about detail
consideRatio Sep 21, 2023
ca068b7
ci: upload codecov report
consideRatio Sep 21, 2023
da9c3ab
ci: fix broken assumption about pytest testpaths config
consideRatio Sep 21, 2023
4e73321
docs: update readme, jupyterlab 3 is now required
consideRatio Sep 21, 2023
754385d
ci: specify non-html codecov location
consideRatio Sep 21, 2023
8f0ff5e
address review comments
bollwyvl Sep 22, 2023
faf66f4
update with review comments
bollwyvl Sep 22, 2023
5dbcfa0
add windows to the matrix
bollwyvl Sep 22, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 18.x
node-version: 20.x
registry-url: https://registry.npmjs.org
cache-dependency-path: labextension/yarn.lock

Expand Down
154 changes: 95 additions & 59 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# This is a GitHub workflow defining a set of jobs with a set of steps.
# ref: https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
# ref: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
#
name: Test

Expand All @@ -23,109 +23,145 @@ on:
- "pre-commit-ci-update-config"
workflow_dispatch:

env:
# avoid warnings about config paths
JUPYTER_PLATFORM_DIRS: "1"
# avoid looking at every version of pip ever released
PIP_DISABLE_PIP_VERSION_CHECK: "1"

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "3.11"

- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 20.x
registry-url: https://registry.npmjs.org
cache-dependency-path: labextension/yarn.lock

- name: Update root build packages
run: pip install --upgrade build

- name: Build Python package
run: pyproject-build

- name: Upload built artifacts
uses: actions/upload-artifact@v3
with:
name: dist-${{ github.run_number }}
path: ./dist

test:
name: ${{ matrix.os }} ${{ matrix.python-version }} ${{ matrix.pip-extras }}
needs: [build]
timeout-minutes: 30
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash # windows default isn't bash

strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, windows-2022]
python-version: ["3.8", "3.11"]
jupyter_server-version: ["1", "2"]
jupyterlab-version: ["3", "4"]
os: [ubuntu-22.04]
include:
- python-version: "3.11"
jupyter_server-version: "2"
jupyterlab-version: "3"
os: windows-2022
- python-version: "3.11"
jupyter_server-version: "2"
jupyterlab-version: "4"
os: windows-2022
pip-extras: ["lab", "classic"]
exclude:
- jupyter_server-version: "1"
jupyterlab-version: "4"

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
# windows should work for all test variations, but a limited selection
# is run to avoid doubling the amount of test runs
- os: windows-2022
python-version: "3.11"
pip-extras: classic
- os: windows-2022
python-version: "3.8"
pip-extras: lab

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
with:
python-version: "${{ matrix.python-version }}"

- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 18.x
registry-url: https://registry.npmjs.org
cache-dependency-path: labextension/yarn.lock

- name: Update root build packages
run: |
pip install --upgrade build pip
run: pip install --upgrade pip

- name: Build Python package
run: |
pyproject-build
- name: Download built artifacts
uses: actions/download-artifact@v3
with:
name: dist-${{ github.run_number }}
path: ./dist

- name: Install Python package
# NOTE: See CONTRIBUTING.md for a local development setup that differs
# slightly from this.
#
# Pytest options are set in `pyproject.toml`.
run: |
pip install -vv $(ls ./dist/jupyter_server_proxy-*.whl)\[acceptance\] 'jupyterlab~=${{ matrix.jupyterlab-version }}.0' 'jupyter_server~=${{ matrix.jupyter_server-version }}.0'
pip install -vv $(ls ./dist/*.whl)\[acceptance,${{ matrix.pip-extras }}\]

- name: List Python packages
run: |
pip freeze
pip check

- name: Run tests
- name: Check server extension for jupyter_server
run: |
pytest -k "not acceptance" -vv

- name: Upload pytest and coverage reports
if: always()
uses: actions/upload-artifact@v3
with:
name: |-
unit-tests-${{ matrix.python-version }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
path: |
./build/pytest
./build/coverage
jupyter server extension list
jupyter server extension list 2>&1 | grep -iE "jupyter_server_proxy.*OK" -

- name: Check the Notebook Server extension is installed
- name: Check server extension for notebook v6
if: contains(matrix.pip-extras, 'classic')
run: |
jupyter serverextension list
jupyter serverextension list 2>&1 | grep -iE "jupyter_server_proxy.*OK" -

- name: Check the Jupyter Server extension is installed
- name: Check frontend extension for notebook v6
if: contains(matrix.pip-extras, 'classic')
run: |
pip install jupyter-server
jupyter server extension list
jupyter server extension list 2>&1 | grep -iE "jupyter_server_proxy.*OK" -
jupyter nbextension list
PYTHONUNBUFFERED=1 jupyter nbextension list 2>&1 | grep -A1 -iE '.*jupyter_server_proxy.*enabled' | grep -B1 -iE "Validating.*OK"

- name: Check the lab extension
- name: Check frontend extension for notebook v7+
if: ${{ !contains(matrix.pip-extras, 'classic') }}
run: |
jupyter labextension list
jupyter labextension list 2>&1 | grep -iE '@jupyterhub/jupyter-server-proxy.*OK.*'
python -m jupyterlab.browser_check
jupyter notebook extension list
jupyter notebook extension list 2>&1 | grep -iE 'jupyter_server_proxy.*OK.*'

- name: Run acceptance tests
- name: Check frontend extension for jupyterlab
run: |
pytest -s -k "acceptance"
jupyter lab extension list
jupyter lab extension list 2>&1 | grep -iE 'jupyter_server_proxy.*OK.*'

- name: Upload acceptance test reports
# we have installed a pre-built wheel and configured code coverage to
# inspect "jupyter_server_proxy", by re-locating to another directory,
# there is no confusion about "jupyter_server_proxy" referring to our
# installed package rather than the local directory
- name: Run tests
run: |
mkdir build
cd build
pytest -c ../pyproject.toml ../tests

- name: Upload test reports
if: always()
uses: actions/upload-artifact@v3
with:
name: |-
acceptance-tests-${{ matrix.python-version }}-${{ matrix.jupyterlab-version }}-${{ github.run_number }}
tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.pip-extras }}-${{ github.run_number }}
path: |
./build/pytest
./build/coverage
./build/robot

# GitHub action reference: https://github.com/codecov/codecov-action
- uses: codecov/codecov-action@v3
with:
directory: build/.coverage
Loading