Skip to content

Upgrade fro JupyterLab 4 #529

Upgrade fro JupyterLab 4

Upgrade fro JupyterLab 4 #529

Workflow file for this run

name: Build
on:
push:
branches: main
pull_request:
branches: '*'
jobs:
test-backend-conda:
name: Test server with Conda Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
# nb_conda_kernels not compatible with 3.12
python-version: ["3.8", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache
CACHE_NUMBER: 3
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ runner.os }}-conda-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
${{ runner.os }}-conda-${{ matrix.python-version }}
- name: Setup Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_gator
auto-update-conda: true
channels: conda-forge
python-version: ${{ matrix.python-version }}
show-channel-urls: true
use-only-tar-bz2: true
- name: Install dependencies
run: |
conda info
conda install -n test_gator --file requirements_dev.txt
# Fake JS assets to avoid building them
touch mamba_gator/labextension/static/style.js
touch mamba_gator/labextension/package.json
pip install -e .
python -m pip check
shell: bash -l {0}
- name: Test the server extension
run: python -m pytest -ra mamba_gator
shell: bash -l {0}
test-backend-mamba:
name: Test server with Mamba Python ${{ matrix.python-version }}
runs-on: ubuntu-latest
strategy:
matrix:
# nb_conda_kernels not compatible with 3.12
python-version: ["3.8", "3.11"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache if requirements_dev.txt has not changed
CACHE_NUMBER: 1
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-mamba-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ runner.os }}-mamba-${{ matrix.python-version }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
${{ runner.os }}-mamba-${{ matrix.python-version }}
- name: Setup Python ${{ matrix.python-version }}
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_gator
auto-update-conda: true
channels: conda-forge
mamba-version: "*"
python-version: ${{ matrix.python-version }}
show-channel-urls: true
use-only-tar-bz2: true
- name: Install dependencies
run: |
conda info
mamba install -n test_gator --file requirements_dev.txt
# Fake JS assets to avoid building them
touch mamba_gator/labextension/static/style.js
touch mamba_gator/labextension/package.json
pip install -e .
python -m pip check
shell: bash -l {0}
- name: Test the server extension
run: python -m pytest -ra mamba_gator
shell: bash -l {0}
test-all-os:
name: Test Conda Python 3.11 on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
continue-on-error: true
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os:
- "macos-latest"
- "windows-latest"
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Cache conda
uses: actions/cache@v3
env:
# Increase this value to reset cache
CACHE_NUMBER: 2
with:
path: ~/conda_pkgs_dir
key: ${{ matrix.os }}-conda-3.11-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
restore-keys: |
${{ matrix.os }}-conda-3.11-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements_dev.txt') }}
${{ matrix.os }}-conda-3.11
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Setup yarn cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
env:
# Increase this value to reset cache
CACHE_NUMBER: 4
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
**/node_modules
key: ${{ runner.os }}-yarn-${{ env.CACHE_NUMBER }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-${{ env.CACHE_NUMBER }}
${{ runner.os }}-yarn
- name: Setup Python 3.11
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_gator
miniconda-version: "latest"
channels: conda-forge
python-version: "3.11"
show-channel-urls: true
use-only-tar-bz2: true
- name: Install dependencies
run: |
conda info
conda install -n test_gator --file requirements_dev.txt
conda install -n test_gator jupyterlab=4
python -m pip install -e .
shell: bash -l {0}
- name: Test the extension
env:
OS_RUNNER: ${{ matrix.os }}
run: |
python -m pytest mamba_gator
yarn run test
jupyter serverextension list
jupyter labextension list
if [ "${OS_RUNNER}" != "windows-latest" ]; then python -m jupyterlab.browser_check; fi
shell: bash -l {0}
build:
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 dependencies
run: python -m pip install -U "jupyterlab>=4.0.0,<5"
- name: Lint the extension
run: |
set -eux
jlpm
jlpm run lint:check
black --check --diff --color .
ruff .
pipx run 'validate-pyproject[all]' pyproject.toml
- name: Build the extension
run: |
set -eux
python -m pip install .[test]
# Check pip dependencies
pip check
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "mamba_gator.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "gator.*OK"
python -m jupyterlab.browser_check
- name: Package the extension
run: |
set -eux
pip install build
python -m build
pip uninstall -y "mamba_gator" jupyterlab
- name: Upload extension packages
uses: actions/upload-artifact@v3
with:
name: extension-artifacts
path: dist/mamba_gator*
if-no-files-found: error
test_isolated:
needs: build
runs-on: ubuntu-latest
steps:
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: 'x64'
- uses: actions/download-artifact@v3
with:
name: extension-artifacts
- 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" mamba_gator*.whl
jupyter server extension list
jupyter server extension list 2>&1 | grep -ie "mamba_gator.*OK"
jupyter labextension list
jupyter labextension list 2>&1 | grep -ie "gator.*OK"
python -m jupyterlab.browser_check --no-browser-test
check_links:
name: Check Links
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1
- uses: jupyterlab/maintainer-tools/.github/actions/check-links@v1