From 4074b2c5db808fa5f94b4889e3542f72acde44bc Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 16 Oct 2023 07:44:01 +0000 Subject: [PATCH 01/11] Add missing `ensured-targets` --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index c24348d..e835cf2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,9 @@ dependencies = ["hatch-jupyter-builder>=0.5"] build-function = "hatch_jupyter_builder.npm_builder" ensured-targets = [ "jupyterlite_xeus_python/labextension/static/style.js", + "jupyterlite_xeus_python/labextension/static/empack_env_meta.json", + "jupyterlite_xeus_python/labextension/static/xpython_wasm.js", + "jupyterlite_xeus_python/labextension/static/xpython_wasm.wasm", "jupyterlite_xeus_python/labextension/package.json", ] skip-if-exists = ["jupyterlite_xeus_python/labextension/static/style.js"] From 97cc69f9dc247fa1acd8a19a16887589342881af Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 16 Oct 2023 07:55:16 +0000 Subject: [PATCH 02/11] bump `jupyterlite-core` --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e835cf2..18f7158 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,7 +23,7 @@ classifiers = [ ] dependencies = [ "traitlets", - "jupyterlite-core>=0.2.0a1,<0.3", + "jupyterlite-core>=0.2.0rc0,<0.3", "requests", "empack>=3.1,<4", "typer", From 8b0c81577eeadd3384c3e05284c66539c041dd31 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 05:55:06 +0000 Subject: [PATCH 03/11] Update build workflow from the template --- .github/workflows/build.yml | 108 ++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 41b8a00..1817e7a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,54 +33,70 @@ jobs: build: runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Conda environment with Micromamba - uses: mamba-org/setup-micromamba@v1 - with: - micromamba-version: '1.5.1-0' - environment-file: environment.yml - cache-environment: true - - - name: Build the extension - run: python -m build - - - uses: actions/upload-artifact@v2 - with: - name: jupyterlite-xeus-python-dist-${{ github.run_number }} - path: ./dist + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Conda environment with Micromamba + uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: '1.5.1-0' + environment-file: environment.yml + cache-environment: true + + - name: Build the extension + run: | + set -eux + python -m pip install .[test] + + jupyter labextension list + jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" + python -m jupyterlab.browser_check + + - name: Package the extension + run: | + set -eux + + pip install build + python -m build + pip uninstall -y "jupyterlite-xeus-python" jupyterlab + + - name: Upload extension packages + uses: actions/upload-artifact@v3 + with: + name: jupyterlite-xeus-python-dist-${{ github.run_number }} + path: dist/jupyterlite-xeus-python* + if-no-files-found: error test_isolated: needs: build runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: '3.10' - architecture: 'x64' - - uses: actions/download-artifact@v2 - with: - name: jupyterlite-xeus-python-dist-${{ github.run_number }} - path: ./dist - - 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 jupyterlite_xeus_python*.tar.gz - pip install "jupyterlab==4" - jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" - - # TODO: add JupyterLite browser check - # python -m jupyterlab.browser_check --no-chrome-test - working-directory: dist + - name: Install Python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + architecture: 'x64' + - uses: actions/download-artifact@v3 + with: + name: jupyterlite-xeus-python-dist-${{ github.run_number }} + - 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 "jupyterlab>=4.0.0,<5" jupyterlite_xeus_python*.whl + + jupyter labextension list + jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" + + # TODO: add JupyterLite browser check + python -m jupyterlab.browser_check --no-browser-test + python-tests-mamba-python: needs: build @@ -198,3 +214,13 @@ jobs: - name: Run tests run: pytest -rP test_xeus_python_env.py working-directory: tests + + + check_links: + name: Check Links + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - uses: actions/checkout@v3 + - uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1 \ No newline at end of file From 714451f85dbc5351c55c27bef8afb5991b6973a0 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 06:02:01 +0000 Subject: [PATCH 04/11] remove whitespace --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1817e7a..1912c62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,7 +33,6 @@ jobs: build: runs-on: ubuntu-latest - steps: - name: Checkout uses: actions/checkout@v4 From cc380501c2a718a5a47a8fd0a5cc285747e583a8 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 06:03:21 +0000 Subject: [PATCH 05/11] fix indent --- .github/workflows/build.yml | 54 ++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1912c62..d6f5a4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -34,39 +34,39 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Install Conda environment with Micromamba - uses: mamba-org/setup-micromamba@v1 - with: - micromamba-version: '1.5.1-0' - environment-file: environment.yml - cache-environment: true + - name: Install Conda environment with Micromamba + uses: mamba-org/setup-micromamba@v1 + with: + micromamba-version: '1.5.1-0' + environment-file: environment.yml + cache-environment: true - - name: Build the extension - run: | - set -eux - python -m pip install .[test] + - name: Build the extension + run: | + set -eux + python -m pip install .[test] - jupyter labextension list - jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" - python -m jupyterlab.browser_check + jupyter labextension list + jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" + python -m jupyterlab.browser_check - - name: Package the extension - run: | - set -eux + - name: Package the extension + run: | + set -eux - pip install build - python -m build - pip uninstall -y "jupyterlite-xeus-python" jupyterlab + pip install build + python -m build + pip uninstall -y "jupyterlite-xeus-python" jupyterlab - - name: Upload extension packages - uses: actions/upload-artifact@v3 - with: - name: jupyterlite-xeus-python-dist-${{ github.run_number }} - path: dist/jupyterlite-xeus-python* - if-no-files-found: error + - name: Upload extension packages + uses: actions/upload-artifact@v3 + with: + name: jupyterlite-xeus-python-dist-${{ github.run_number }} + path: dist/jupyterlite-xeus-python* + if-no-files-found: error test_isolated: needs: build From 4dbcfaec4f61cb8fa58528b6e49acd42399d324d Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 06:16:13 +0000 Subject: [PATCH 06/11] debug --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d6f5a4d..6c427e7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -46,7 +46,6 @@ jobs: - name: Build the extension run: | - set -eux python -m pip install .[test] jupyter labextension list @@ -57,7 +56,6 @@ jobs: run: | set -eux - pip install build python -m build pip uninstall -y "jupyterlite-xeus-python" jupyterlab From 164752204567ac52cb41aa89bb5774d6b2bb9650 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 06:26:07 +0000 Subject: [PATCH 07/11] keep only build step --- .github/workflows/build.yml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c427e7..c6b0f04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,14 +45,6 @@ jobs: cache-environment: true - name: Build the extension - run: | - python -m pip install .[test] - - jupyter labextension list - jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" - python -m jupyterlab.browser_check - - - name: Package the extension run: | set -eux From f88bd8df695b5b54ce0e32f9317394bccc52ced7 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 06:26:35 +0000 Subject: [PATCH 08/11] remove uneeded command --- .github/workflows/build.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6b0f04..d01eb2c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -47,9 +47,7 @@ jobs: - name: Build the extension run: | set -eux - python -m build - pip uninstall -y "jupyterlite-xeus-python" jupyterlab - name: Upload extension packages uses: actions/upload-artifact@v3 From 39fe56d04b0fd278b86d5d5ec36250121b434711 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 06:33:28 +0000 Subject: [PATCH 09/11] fix upload path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d01eb2c..87a2e05 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,7 +53,7 @@ jobs: uses: actions/upload-artifact@v3 with: name: jupyterlite-xeus-python-dist-${{ github.run_number }} - path: dist/jupyterlite-xeus-python* + path: dist if-no-files-found: error test_isolated: From bd391bc2be14fde9a0240326991aa2657f4412d5 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 06:53:48 +0000 Subject: [PATCH 10/11] remove comment --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87a2e05..b383894 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -81,7 +81,6 @@ jobs: jupyter labextension list jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" - # TODO: add JupyterLite browser check python -m jupyterlab.browser_check --no-browser-test From abf13908354511576a14a2d4db86472083916218 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Tue, 17 Oct 2023 09:25:50 +0200 Subject: [PATCH 11/11] Fix wheel include --- pyproject.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 18f7158..0566ced 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,10 @@ fields = ["description", "authors", "urls"] artifacts = ["jupyterlite_xeus_python/labextension"] exclude = [".github"] +[tool.hatch.build.targets.wheel] +artifacts = ["jupyterlite_xeus_python/labextension"] +include = ["jupyterlite_xeus_python/"] + [tool.hatch.build.targets.wheel.shared-data] "jupyterlite_xeus_python/labextension" = "share/jupyter/labextensions/@jupyterlite/xeus-python-kernel" "install.json" = "share/jupyter/labextensions/@jupyterlite/xeus-python-kernel/install.json"