Skip to content

Commit

Permalink
Backport PR #1334 on branch 0.3.x (Do not clean up resources after ex…
Browse files Browse the repository at this point in the history
…ecution) (#1336)

* Backport PR #1334: Do not clean up resources after execution

* Try getting some CI green

* Iterate

---------

Co-authored-by: martinRenou <martin.renou@gmail.com>
  • Loading branch information
meeseeksmachine and martinRenou authored Jun 22, 2023
1 parent 0880523 commit c736653
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,40 @@ jobs:
- name: Base Setup
uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1

- name: Setup mamba
uses: conda-incubator/setup-miniconda@v2
with:
mamba-version: "*"
channels: conda-forge

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs==16.19.0 yarn==1 flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"

- name: Install Dependencies
shell: bash -l {0}
run: |
python -m pip install -U jupyterlab~=3.0 jupyter_packaging~=0.10
- name: Install the Voilà Preview JupyterLab extension
shell: bash -l {0}
run: |
python -m pip install .
- name: Check the extensions are installed
shell: bash -l {0}
run: |
jupyter nbextension list 2>&1 | grep -ie "voila/extension.*enabled" -
jupyter labextension list 2>&1 | grep -ie "@voila-dashboards/jupyterlab-preview.*enabled.*ok" -
jupyter server extension list 2>&1 | grep -ie "voila\.server_extension.*enabled" -
- name: Browser check
shell: bash -l {0}
run: |
python -m jupyterlab.browser_check
- name: Lint
shell: bash -l {0}
run: |
jlpm
jlpm run eslint:check
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

- name: Create the conda environment
shell: bash -l {0}
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs yarn flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"
run: mamba install -q python=${{ matrix.python_version }} pip jupyterlab_pygments==0.1.0 pytest-cov pytest-rerunfailures nodejs==16.19.0 yarn==1 flake8 ipywidgets matplotlib xeus-cling openssl=1.1.1l "traitlets>=5.0.3,<6"

- name: Install dependencies
shell: bash -l {0}
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
test-osx:

runs-on: ${{ matrix.os }}

strategy:
Expand Down
8 changes: 0 additions & 8 deletions voila/notebook_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,6 @@ async def _jinja_notebook_execute(self, nb, kernel_id):
# (it seems to be local to our block)
nb.cells = result.cells

await self._cleanup_resources()

async def _jinja_cell_generator(self, nb, kernel_id):
"""Generator that will execute a single notebook cell at a time"""
nb, _ = ClearOutputPreprocessor().preprocess(
Expand Down Expand Up @@ -302,12 +300,6 @@ async def _jinja_cell_generator(self, nb, kernel_id):
finally:
yield output_cell

await self._cleanup_resources()

async def _cleanup_resources(self):
await ensure_async(self.executor.km.cleanup_resources())
await ensure_async(self.executor.kc.stop_channels())

async def load_notebook(self, path):

model = await ensure_async(self.contents_manager.get(path=path))
Expand Down

0 comments on commit c736653

Please sign in to comment.