From 0056777c30da8c2024f1b49c3f15d3bb2f176c22 Mon Sep 17 00:00:00 2001 From: Duc Trung LE Date: Tue, 7 Nov 2023 10:06:52 +0100 Subject: [PATCH] Add notebook v6 workflow --- .github/workflows/build.yml | 46 +++++++++++++++++++++++++++++++++++-- pyproject.toml | 3 ++- 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b3b0ea8..82d0b25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,8 @@ on: branches: '*' jobs: - build: + lab-build: + name: JupyterLab Build runs-on: ubuntu-latest steps: - name: Checkout @@ -27,7 +28,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install jupyter_packaging jupyterlab + python -m pip install jupyter_packaging jupyterlab hatch - name: Install the extension run: | @@ -48,3 +49,44 @@ jobs: run: | jlpm && jlpm build jlpm run test + + - name: Build the extension + run: | + python -m hatch build + + - uses: actions/upload-artifact@v3 + with: + name: gridstack-package + path: dist/*.whl + + classic-notebook: + name: Notebook v6 Build + needs: lab-build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - uses: actions/download-artifact@v3 + with: + name: gridstack-package + path: dist + + - name: Install Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + architecture: 'x64' + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install "notebook<7" + + - name: Install the extension + run: | + pip install dist/*.whl + + - name: Check the extensions are installed + run: | + jupyter nbextension list 2>&1 | grep -ie "voila-gridstack/extension.*enabled" - diff --git a/pyproject.toml b/pyproject.toml index 35c17a6..39244e2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -54,6 +54,7 @@ source = "nodejs" [tool.hatch.metadata.hooks.nodejs] fields = ["description", "authors", "urls"] + [tool.hatch.build.targets.sdist] artifacts = [ "/voila_gridstack/labextension", @@ -61,7 +62,7 @@ artifacts = [ "/voila_gridstack/template", "/voila_gridstack/config", ] -exclude = ["/.github", "/binder", "node_modules"] +exclude = ["/.github", "/binder", "node_modules", "assets", "docs", "examples"] [tool.hatch.build.targets.wheel.shared-data] "voila_gridstack/config/jpserver-voila-gridstack.json" = "etc/jupyter/jupyter_server_config.d/jpserver-voila-gridstack.json"