From 5adbb27389b166dcfea82735cd99d875cbcdf537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Collonval?= Date: Mon, 12 Jun 2023 10:09:54 +0200 Subject: [PATCH] Switch to JupyterLab 4 (#115) * Update for lab 4.0 Relax more versions to get a valid resolution Fix typo Further resolution fixes More unpinning and bumping (need recent Python to install Lab 4) Commend out offline notebook extension Unpin invoke, comment out C kernel Formatting for pip Reinstate x stack Try without leading slash xleaflet 0.17 does not exist? Though it is tagged: https://github.com/jupyter-xeus/xleaflet/releases/tag/0.17.0 Unpin x stack Comment out all x stack except for xeus-cling Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com> * Try fixing setup-miniconda config > The env file works locally... * Give anothter try * Add note about use-only-tar-bz2 * Test no r packages on binder * Restore r installation * Don't use nodefaults for r task * Pre install r packages This will optimize the cached layer and hopefully solve the postBuild bug * Another try * back to the working commit without r * Restore nodefaults for r task as we skip it for now. --------- Co-authored-by: krassowski <5832902+krassowski@users.noreply.github.com> --- .binder/environment.yml | 45 +++++++++++++++++++------------------- .binder/postBuild | 2 +- .github/workflows/main.yml | 10 +++++---- tasks.py | 8 ++----- 4 files changed, 32 insertions(+), 33 deletions(-) diff --git a/.binder/environment.yml b/.binder/environment.yml index 7618afa..25c86ad 100644 --- a/.binder/environment.yml +++ b/.binder/environment.yml @@ -3,35 +3,35 @@ channels: - nodefaults dependencies: # !! you can only use single `=` to set a version. Otherwise it will break the update job -- invoke=1.7.3 +- invoke=2.1.2 - packaging - pyyaml # applications -- jupyterlab=3.5.0 -- retrolab=0.3.21 -- nbconvert=7.2.5 +- jupyterlab=4.0.1 +- jupyter-collaboration=1.0.0 +- nbconvert=7.4.0 +- pip: + - notebook==7.0.0b3 # extensions -- jupyter-offlinenotebook=0.2 -- jupyterlab-fasta=3.2.0 -- jupyterlab-geojson=3.3.1 -- jupyterlab-link-share=0.2 +- jupyter-offlinenotebook=0.2.2 +- jupyterlab-fasta=3.3 +- jupyterlab-geojson=3.4 # Python Kernel -- ipykernel=6.16.2 +- ipykernel=6.23.1 - xeus-python=0.14.3 -- ipywidgets=8.0.2 -- widgetsnbextension=4.0.3 -- ipyleaflet=0.17.2 -- altair=4.2.0 -- bqplot=0.12.36 -- dask=2021.10.0 -- matplotlib-base=3.5.3 -- pandas=1 +- ipywidgets=8 +- ipyleaflet=0.17.3 +- altair=5.0.1 +- bqplot=0.12.39 +- dask=2023.5.1 +- matplotlib-base=3.7.1 +- pandas=2.0.2 - python=3.9 -- scikit-image=0.19.2 -- scikit-learn=1.0.2 -- seaborn=0.12.1 -- tensorflow=2 -- sympy=1.10.1 +- scikit-image=0.20.0 +- scikit-learn=1.2.2 +- seaborn-base=0.12.2 +- tensorflow=2.11.0 +- sympy=1.12 - traittypes=0.2.1 # C++ Kernel - xeus-cling=0.13.0 @@ -40,4 +40,5 @@ dependencies: - xwidgets=0.26.1 - xleaflet=0.16.0 # CLI tools +- pip - vim diff --git a/.binder/postBuild b/.binder/postBuild index 4ce345d..d88715f 100644 --- a/.binder/postBuild +++ b/.binder/postBuild @@ -1,6 +1,6 @@ set -ex -invoke r --env-name=notebook +# invoke r --env-name=notebook invoke demofiles invoke talk -t demo rm -rf demofiles diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 810a146..f310cd6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,12 +26,14 @@ jobs: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('.binder/environment.yml') }} - uses: conda-incubator/setup-miniconda@v2 with: - mamba-version: "*" - channels: conda-forge,defaults - channel-priority: true + mamba-version: ">=1.4.0" + # Defaults is added automatically + channels: conda-forge + channel-priority: "strict" activate-environment: jupyterlab-demo environment-file: .binder/environment.yml - use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! + # The following option is blocking the environment resolution (newer versions are not found) + # use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly! - run: | conda info conda list diff --git a/tasks.py b/tasks.py index 35467be..6e5897d 100644 --- a/tasks.py +++ b/tasks.py @@ -61,10 +61,8 @@ def build(ctx, env_name=env_name, kernel=True): """ if kernel: - path = os.environ.get("PATH") ctx.run( - f"{source!s} activate {env_name!s} && ipython kernel install --name {env_name!s} --display-name {env_name!s} --sys-prefix", - env={"PATH": f"{activate_path()}:{path}"}, + f"conda run -n {env_name!s} ipython kernel install --name {env_name!s} --display-name {env_name!s} --sys-prefix" ) @@ -178,10 +176,8 @@ def r(ctx, env_name=env_name): """ Installs the r kernel and associated libs. """ - path = os.environ.get("PATH") ctx.run( - f"{source!s} activate {env_name!s} && mamba install -yc conda-forge -c nodefaults r-irkernel r-ggplot2", - env={"PATH": f"{activate_path()}:{path}"}, + f"mamba install -yn {env_name!s} -c conda-forge -c nodefaults r-irkernel r-ggplot2", )