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

JupyterLab Extension to Launch Text Notebooks #1154

Merged
merged 19 commits into from
Nov 12, 2023
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
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
22 changes: 13 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ on:
description: Upload build artifacts
push:
paths-ignore:
- 'CHANGELOG.md'
branches: [ main ]
- "CHANGELOG.md"
branches: [main]
pull_request:
branches: [ main ]
branches: [main]
schedule:
- cron: '0 11 * * 4'
- cron: "0 11 * * 4"

permissions:
# All nested workflows will inherit these permissions and so no need to declare
Expand All @@ -34,25 +34,29 @@ jobs:
uses: ./.github/workflows/step_pre-commit.yml

codeql:
needs: [ pre-commit ]
needs: [pre-commit]
uses: ./.github/workflows/step_static-analysis.yml

test-pip:
needs: [ codeql ]
needs: [codeql]
uses: ./.github/workflows/step_tests-pip.yml

test-conda:
needs: [ codeql ]
needs: [codeql]
uses: ./.github/workflows/step_tests-conda.yml

test-ui:
needs: [codeql]
uses: ./.github/workflows/step_tests-ui.yml

build:
needs: [ test-pip, test-conda ]
needs: [test-pip, test-conda, test-ui]
uses: ./.github/workflows/step_build.yml
with:
upload: ${{ inputs.upload-build-artifacts || false }}

pass:
needs: [ pre-commit, codeql, test-pip, test-conda, build ]
needs: [pre-commit, codeql, test-pip, test-conda, test-ui, build]
runs-on: ubuntu-latest
steps:
- name: Check jobs
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/step_tests-ui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: test-ui
run-name: Run UI tests with Galata

on:
workflow_call:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-ui-test
cancel-in-progress: true

jobs:
test-ui:
continue-on-error: false
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 from source (required for the pre-commit tests)
run: python -m pip install -e '.[test-cov]'

- name: Install galata
working-directory: jupyterlab/packages/jupyterlab-jupytext-extension/ui-tests
env:
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: 1
run: jlpm install

- name: Install browser
working-directory: jupyterlab/packages/jupyterlab-jupytext-extension/ui-tests
run: jlpm playwright install chromium

- name: Integration tests
working-directory: jupyterlab/packages/jupyterlab-jupytext-extension/ui-tests
run: jlpm playwright test

- name: Upload UI Test artifacts
if: failure()
uses: actions/upload-artifact@v3
with:
name: ui-test-output
path: |
jupyterlab/packages/jupyterlab-jupytext-extension/ui-tests/test-results
4 changes: 4 additions & 0 deletions jupyterlab/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ lib/
*.egg-info/
.ipynb_checkpoints
*.tsbuildinfo

# Ignore playwright stuff
**/playwright-report
**/test-results
2 changes: 1 addition & 1 deletion jupyterlab/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "tsconfig.eslint.json",
"project": "packages/**/tsconfig.json",
"sourceType": "module",
"tsconfigRootDir": "."
},
Expand Down
14 changes: 11 additions & 3 deletions jupyterlab/packages/jupyterlab-jupytext-extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
"type": "git",
"url": "https://github.com/mwouts/jupytext.git"
},
"workspaces": [
"ui-tests"
],
"scripts": {
"build": "jlpm run build:lib && jlpm run build:labextension:dev && jlpm run copy:extensioncfgfile",
"build:labextension": "jupyter labextension build .",
Expand All @@ -35,7 +38,7 @@
"clean:all": "jlpm run clean:lib && jlpm run clean:labextension",
"clean:labextension": "rimraf ../../jupyterlab_jupytext/labextension",
"clean:lib": "rimraf lib tsconfig.tsbuildinfo",
"install:extension": "jupyter labextension develop --overwrite .",
"install:extension": "python ../../scripts/install_extension.py",
"watch": "run-p watch:src watch:labextension",
"watch:labextension": "jupyter labextension watch .",
"watch:src": "tsc -w"
Expand Down Expand Up @@ -65,18 +68,23 @@
"@jupyterlab/application": "^4.0.0",
"@jupyterlab/apputils": "^4.0.0",
"@jupyterlab/codeeditor": "^4.0.0",
"@jupyterlab/docregistry": "^4.0.0",
"@jupyterlab/filebrowser": "^4.0.0",
"@jupyterlab/launcher": "^4.0.0",
"@jupyterlab/nbformat": "^4.0.0",
"@jupyterlab/notebook": "^4.0.0",
"@jupyterlab/rendermime": "^4.0.0",
"@jupyterlab/settingregistry": "^4.0.0",
"@jupyterlab/translation": "^4.0.0",
"@jupyterlab/ui-components": "^4.0.0",
"@lumino/coreutils": "^2.0.0",
"@lumino/disposable": "^2.0.0",
"jupyterlab-rise": "^0.41.0"
},
"devDependencies": {
"@jupyterlab/builder": "^4.0.0",
"npm-run-all": "^4.1.5",
"rimraf": "^3.0.2",
"typescript": "~5.0.1"
"rimraf": "^4.4.1",
"typescript": "~5.0.2"
}
}
161 changes: 161 additions & 0 deletions jupyterlab/packages/jupyterlab-jupytext-extension/schema/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
{
"title": "Jupytext",
"description": "Jupytext Menu Settings.",
"jupyter.lab.menus": {
"main": [
{
"id": "jp-mainmenu-jupytext-menu",
"label": "Jupytext",
"rank": 80,
"items": [
{
"type": "submenu",
"submenu": {
"id": "jp-mainmenu-jupytext-new",
"label": "New Text Notebook",
"items": [
{
"command": "jupytext:create-new-text-noteboook-auto:light",
"rank": 1
},
{
"command": "jupytext:create-new-text-noteboook-auto:percent",
"rank": 5
},
{
"command": "jupytext:create-new-text-noteboook-auto:hydrogen",
"rank": 10
},
{
"command": "jupytext:create-new-text-noteboook-auto:nomarker",
"rank": 15
},
{
"type": "separator",
"rank": 16
},
{
"command": "jupytext:create-new-text-noteboook-md",
"rank": 20
},
{
"command": "jupytext:create-new-text-noteboook-md:myst",
"rank": 25
},
{
"type": "separator",
"rank": 26
},
{
"command": "jupytext:create-new-text-noteboook-Rmd",
"rank": 30
},
{
"command": "jupytext:create-new-text-noteboook-qmd",
"rank": 35
}
]
},
"rank": 1
},
{
"type": "submenu",
"submenu": {
"id": "jp-mainmenu-jupytext-new",
"label": "Pair Notebook",
"items": [
{
"command": "jupytext:ipynb",
"rank": 1
},
{
"type": "separator",
"rank": 2
},
{
"command": "jupytext:auto:light",
"rank": 5
},
{
"command": "jupytext:auto:percent",
"rank": 10
},
{
"command": "jupytext:auto:hydrogen",
"rank": 15
},
{
"command": "jupytext:auto:nomarker",
"rank": 20
},
{
"type": "separator",
"rank": 25
},
{
"command": "jupytext:md",
"rank": 30
},
{
"command": "jupytext:md:myst",
"rank": 35
},
{
"type": "separator",
"rank": 40
},
{
"command": "jupytext:Rmd",
"rank": 45
},
{
"command": "jupytext:qmd",
"rank": 50
},
{
"type": "separator",
"rank": 55
},
{
"command": "jupytext:custom",
"rank": 60
},
{
"type": "separator",
"rank": 65
},
{
"command": "jupytext:none",
"rank": 70
}
]
},
"rank": 10
},
{
"type": "separator",
"rank": 11
},
{
"command": "jupytext:metadata",
"rank": 30
},
{
"type": "separator",
"rank": 31
},
{
"command": "jupytext:faq",
"rank": 40
},
{
"command": "jupytext:reference",
"rank": 41
}
]
}
]
},
"additionalProperties": false,
"type": "object"
}
Loading
Loading