This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
Add support for pip dependencies #475
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build | |
on: | |
push: | |
branches: main | |
pull_request: | |
branches: '*' | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Conda environment with Micromamba | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
environment-name: xeus-python-kernel | |
environment-file: environment.yml | |
- name: Dev install | |
run: | | |
set -eux | |
jlpm | |
jlpm run build | |
jlpm run eslint:check | |
python -m pip install -v . | |
jupyter labextension list 2>&1 | grep -ie "@jupyterlite/xeus-python-kernel.*OK" | |
- name: Build the extension | |
run: | | |
pip install build | |
python -m build --sdist | |
cp dist/*.tar.gz jupyterlite-xeus-python.tar.gz | |
pip uninstall -y jupyterlite-xeus-python jupyterlab | |
rm -rf jupyterlite-xeus-python | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: jupyterlite-xeus-python-sdist | |
path: jupyterlite-xeus-python.tar.gz | |
test_isolated: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- 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-sdist | |
- 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==3" | |
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 | |
python-tests-mamba-python: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: jupyterlite-xeus-python-sdist | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: xeus-python-kernel | |
environment-file: environment.yml | |
python-version: '3.10' | |
- name: Install mamba | |
run: conda install -c conda-forge mamba | |
- name: Make sure the Mamba Python API is available | |
run: | | |
mamba install mamba | |
python -c "from mamba.api import create" | |
- name: Install | |
run: pip install jupyterlite-xeus-python.tar.gz | |
- name: Run tests | |
run: pytest -rP test_xeus_python_env.py | |
working-directory: tests | |
python-tests-mamba: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: jupyterlite-xeus-python-sdist | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: xeus-python-kernel | |
environment-file: environment.yml | |
python-version: '3.10' | |
- name: Install mamba | |
run: conda install -c conda-forge mamba | |
- name: Install | |
run: pip install jupyterlite-xeus-python.tar.gz | |
- name: Run tests | |
run: pytest -rP test_xeus_python_env.py | |
working-directory: tests | |
python-tests-micromamba: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: jupyterlite-xeus-python-sdist | |
- name: Install mamba | |
uses: mamba-org/provision-with-micromamba@main | |
with: | |
micromamba-version: '0.22.0' | |
environment-file: environment.yml | |
environment-name: xeus-python-kernel | |
- name: Install | |
run: pip install jupyterlite-xeus-python.tar.gz | |
- name: Run tests | |
run: pytest -rP test_xeus_python_env.py | |
working-directory: tests | |
python-tests-conda: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/download-artifact@v2 | |
with: | |
name: jupyterlite-xeus-python-sdist | |
- name: Setup conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
activate-environment: xeus-python-kernel | |
environment-file: environment.yml | |
python-version: '3.10' | |
- name: Install | |
run: pip install jupyterlite-xeus-python.tar.gz | |
- name: Run tests | |
run: pytest -rP test_xeus_python_env.py | |
working-directory: tests |