-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update CI * Add dev install script * Automatic application of license header * Add update snapshots workflow * Update snapshots --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
78a91ca
commit 8ce9473
Showing
15 changed files
with
3,249 additions
and
3,272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,9 +28,7 @@ jobs: | |
- name: Install dependencies | ||
run: | | ||
pip install "jupyterlab>=4.0.0,<5" | ||
pip install -e . | ||
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e projects/jupyter-server-ydoc | ||
jlpm | ||
jlpm install | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
@@ -55,6 +53,7 @@ jobs: | |
test-js: | ||
name: Test JavaScript | ||
runs-on: ubuntu-latest | ||
needs: [pre-commit] | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
@@ -69,13 +68,7 @@ jobs: | |
|
||
- name: Install dependencies | ||
run: | | ||
pip install "jupyterlab>=4.0.0,<5" | ||
pip install -e . | ||
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e projects/jupyter-server-ydoc | ||
jupyter labextension develop --overwrite projects/jupyter-collaboration-ui | ||
jupyter labextension develop --overwrite projects/jupyter-docprovider | ||
jlpm | ||
jlpm build | ||
yarn dev | ||
- name: Run Tests | ||
run: | | ||
|
@@ -84,13 +77,14 @@ jobs: | |
test-py: | ||
name: Test Python | ||
needs: [pre-commit] | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] | ||
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] | ||
# PyPy is not supported because we use the file_id_manager. See: | ||
# https://github.com/jupyter-server/jupyter_server_fileid/issues/44 | ||
#include: | ||
|
@@ -106,9 +100,8 @@ jobs: | |
|
||
- name: Install the Python dependencies | ||
run: | | ||
python -m pip install "jupyterlab>=4.0.0,<5" | ||
python -m pip install -e ".[test]" codecov | ||
python -m pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e "projects/jupyter-server-ydoc[test]" | ||
python -m pip install codecov | ||
yarn dev | ||
- name: List installed packages | ||
run: | | ||
|
@@ -148,7 +141,7 @@ jobs: | |
test_minimum_versions: | ||
name: Test Minimum Versions | ||
needs: [pre-commit, test-js, test-py] | ||
needs: [test-js, test-py] | ||
timeout-minutes: 20 | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -157,21 +150,20 @@ jobs: | |
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
with: | ||
python_version: "3.8" | ||
python_version: "3.9" | ||
dependency_type: minimum | ||
|
||
- name: Install the Python dependencies | ||
run: | | ||
pip install -e ".[test]" | ||
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e "projects/jupyter-server-ydoc[test]" | ||
yarn dev | ||
- name: Run the unit tests | ||
run: | | ||
pytest -vv -W default || pytest -vv -W default --lf | ||
test_prereleases: | ||
name: Test Prereleases | ||
needs: [pre-commit, test-js, test-py] | ||
needs: [test-js, test-py] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
steps: | ||
|
@@ -183,8 +175,7 @@ jobs: | |
|
||
- name: Install the Python dependencies | ||
run: | | ||
pip install -e ".[test]" | ||
pip install -e projects/jupyter-collaboration-ui -e projects/jupyter-docprovider -e "projects/jupyter-server-ydoc[test]" | ||
yarn dev | ||
- name: List installed packages | ||
run: | | ||
|
@@ -197,7 +188,7 @@ jobs: | |
make_sdist: | ||
name: Make SDist | ||
needs: [pre-commit, test-js, test-py] | ||
needs: [pre-commit] | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
steps: | ||
|
@@ -269,16 +260,21 @@ jobs: | |
|
||
ui_tests: | ||
runs-on: ubuntu-latest | ||
needs: [pre-commit, test-js] | ||
needs: [make_sdist] | ||
timeout-minutes: 30 | ||
env: | ||
PLAYWRIGHT_BROWSERS_PATH: ${{ github.workspace }}/pw-browsers | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
- name: Download sdist | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: "sdist" | ||
- name: Install dependencies | ||
run: | | ||
pip install jupyterlab . | ||
pip install jupyterlab jupyter_collaboration_ui*.tar.gz jupyter_docprovider*.tar.gz jupyter_server_ydoc*.tar.gz | ||
- name: Install playwright | ||
env: | ||
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Update Galata References | ||
|
||
on: | ||
issue_comment: | ||
types: [created, edited] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
jobs: | ||
update-snapshots: | ||
if: > | ||
( | ||
github.event.comment.author_association == 'OWNER' || | ||
github.event.comment.author_association == 'COLLABORATOR' || | ||
github.event.comment.author_association == 'MEMBER' | ||
) && github.event.issue.pull_request && contains(github.event.comment.body, 'please update snapshots') | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: React to the triggering comment | ||
run: | | ||
gh api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions --raw-field 'content=+1' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Get PR Info | ||
id: pr | ||
env: | ||
PR_NUMBER: ${{ github.event.issue.number }} | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GH_REPO: ${{ github.repository }} | ||
COMMENT_AT: ${{ github.event.comment.created_at }} | ||
run: | | ||
pr="$(gh api /repos/${GH_REPO}/pulls/${PR_NUMBER})" | ||
head_sha="$(echo "$pr" | jq -r .head.sha)" | ||
pushed_at="$(echo "$pr" | jq -r .pushed_at)" | ||
if [[ $(date -d "$pushed_at" +%s) -gt $(date -d "$COMMENT_AT" +%s) ]]; then | ||
echo "Updating is not allowed because the PR was pushed to (at $pushed_at) after the triggering comment was issued (at $COMMENT_AT)" | ||
exit 1 | ||
fi | ||
echo "head_sha=$head_sha" >> $GITHUB_OUTPUT | ||
- name: Checkout the branch from the PR that triggered the job | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh pr checkout ${{ github.event.issue.number }} | ||
|
||
- name: Validate the fetched branch HEAD revision | ||
env: | ||
EXPECTED_SHA: ${{ steps.pr.outputs.head_sha }} | ||
run: | | ||
actual_sha="$(git rev-parse HEAD)" | ||
if [[ "$actual_sha" != "$EXPECTED_SHA" ]]; then | ||
echo "The HEAD of the checked out branch ($actual_sha) differs from the HEAD commit available at the time when trigger comment was submitted ($EXPECTED_SHA)" | ||
exit 1 | ||
fi | ||
- name: Base Setup | ||
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 | ||
|
||
- name: Build the extension | ||
run: yarn dev | ||
|
||
- uses: jupyterlab/maintainer-tools/.github/actions/update-snapshots@main | ||
with: | ||
npm_client: jlpm | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
start_server_script: 'null' | ||
test_folder: ui-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Copyright (c) Jupyter Development Team. | ||
# Distributed under the terms of the Modified BSD License. | ||
|
||
import subprocess | ||
from pathlib import Path | ||
from typing import Optional | ||
|
||
|
||
def execute(cmd: str, cwd: Optional[Path] = None) -> None: | ||
subprocess.run(cmd.split(" "), check=True, cwd=cwd) | ||
|
||
|
||
def install_dev() -> None: | ||
install_build_deps = "python -m pip install jupyterlab>=4,<5" | ||
install_js_deps = "jlpm install" | ||
|
||
python_package_prefix = "projects" | ||
python_packages = ["jupyter-collaboration-ui", "jupyter-docprovider", "jupyter-server-ydoc"] | ||
|
||
execute(install_build_deps) | ||
execute(install_js_deps) | ||
|
||
for py_package in python_packages: | ||
real_package_name = py_package.replace("-", "_") | ||
execute(f"pip uninstall {real_package_name} -y") | ||
execute(f"pip install -e {python_package_prefix}/{py_package}[test]") | ||
|
||
# List of server extensions | ||
if py_package in ["jupyter-server-ydoc"]: | ||
execute(f"jupyter server extension enable {real_package_name}") | ||
|
||
# List of jupyterlab extensions | ||
if py_package in ["jupyter-collaboration-ui", "jupyter-docprovider"]: | ||
execute( | ||
f"jupyter labextension develop --overwrite {python_package_prefix}/{py_package} --overwrite" | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
install_dev() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-8 Bytes
(100%)
...ts/collaborationpanel.spec.ts-snapshots/one-client-with-two-documents-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+45 Bytes
(100%)
...tests/notebook.spec.ts-snapshots/initialization-create-notebook-guest-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-30.7 KB
(69%)
...s/tests/notebook.spec.ts-snapshots/initialization-open-notebook-guest-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified
BIN
-30.7 KB
(69%)
...ts/tests/notebook.spec.ts-snapshots/initialization-open-notebook-host-linux.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.