From 5630d2cc42b3584289597abefd60417886349694 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 13 Dec 2021 17:01:15 +0100 Subject: [PATCH 1/3] Use `maintainer-tools` base setup action --- .github/workflows/build.yml | 14 +++--------- .github/workflows/check-release.yml | 35 +++-------------------------- .github/workflows/packaging.yml | 18 +++++++-------- .github/workflows/ui-tests.yml | 33 +++------------------------ 4 files changed, 17 insertions(+), 83 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 508ef9bc3..f76f41bda 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,20 +17,12 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Install node - uses: actions/setup-node@v1 - with: - node-version: '12.x' - - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - architecture: 'x64' + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install Dependencies run: | - python -m pip install -U pip jupyterlab~=3.0 jupyter_packaging~=0.10 'nbclassic!=0.3.3' + python -m pip install -U jupyterlab~=3.0 jupyter_packaging~=0.10 - name: Install the VoilĂ  Preview JupyterLab extension run: | diff --git a/.github/workflows/check-release.yml b/.github/workflows/check-release.yml index 73ed390b6..b9433f51a 100644 --- a/.github/workflows/check-release.yml +++ b/.github/workflows/check-release.yml @@ -17,41 +17,12 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: 3.9 - architecture: 'x64' - - - name: Install node - uses: actions/setup-node@v2 - with: - node-version: '14.x' - - - name: Get pip cache dir - id: pip-cache - run: | - echo "::set-output name=dir::$(pip cache dir)" - - - name: Cache pip - uses: actions/cache@v1 - with: - path: ${{ steps.pip-cache.outputs.dir }} - key: ${{ runner.os }}-pip-${{ hashFiles('setup.py') }} - restore-keys: | - ${{ runner.os }}-pip- - - - name: Cache checked links - uses: actions/cache@v2 - with: - path: ~/.cache/pytest-link-check - key: ${{ runner.os }}-linkcheck-${{ hashFiles('**/.md') }}-md-links - restore-keys: | - ${{ runner.os }}-linkcheck- + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Upgrade packaging dependencies run: | - pip install --upgrade pip setuptools wheel jupyter-packaging~=0.10 --user + pip install --upgrade jupyter-packaging~=0.10 --user - name: Install Dependencies run: | diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index a8537e122..0be262253 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -21,32 +21,30 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Install node - uses: actions/setup-node@v1 - with: - node-version: '14.x' - - name: Install Python - uses: actions/setup-python@v2 - with: - python-version: '3.9' - architecture: 'x64' + + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 + - name: Install dependencies run: | - python -m pip install --upgrade pip wheel python -m pip install setuptools jupyter_packaging~=0.10 "jupyterlab>=3,<4" build + - name: Build pypi distributions run: | python -m build + - name: Build npm distributions run: | pushd packages/jupyterlab-preview npm pack popd cp packages/*/*.tgz dist + - name: Build checksum file run: | cd dist sha256sum * | tee SHA256SUMS + - name: Upload distributions uses: actions/upload-artifact@v2 with: diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 311b736f8..b480bbe2b 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -13,40 +13,13 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python }} - - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '16.x' - - name: Cache pip on Linux - uses: actions/cache@v2 - if: startsWith(runner.os, 'Linux') - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ matrix.python }}-${{ hashFiles('setup.py') }} - restore-keys: | - ${{ runner.os }}-pip-${{ matrix.python }} - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - name: Cache yarn - uses: actions/cache@v2 - id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + - name: Base Setup + uses: jupyterlab/maintainer-tools/.github/actions/base-setup@v1 - name: Install dependencies run: | - python -m pip install --upgrade pip jupyterlab~=3.0 numpy bqplot matplotlib ipympl==0.8.0 ipyvolume scipy + python -m pip install --upgrade jupyterlab~=3.0 numpy bqplot matplotlib ipympl==0.8.0 ipyvolume scipy python -m pip install ".[test]" jlpm jlpm build From 120382cd6972a5f2372be0dc3e0d2359c899a0ce Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 13 Dec 2021 17:11:22 +0100 Subject: [PATCH 2/3] Test on Python 3.7 - 3.10 --- .github/workflows/main.yml | 5 ++--- .github/workflows/packaging.yml | 6 +++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 44b7bc613..d576959c4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, macos-latest] - python_version: [3.6, 3.7, 3.8, 3.9] + python_version: ['3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 @@ -44,7 +44,6 @@ jobs: (cd tests/skip_template; pip install .) - name: Run tests (with traitlets 5) - if: matrix.python_version != '3.6' shell: bash -l {0} run: | pip install "traitlets>=5.0.3,<6" @@ -76,7 +75,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: ['3.7', '3.8', '3.9'] + python-version: ['3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/packaging.yml b/.github/workflows/packaging.yml index 0be262253..f342e5506 100644 --- a/.github/workflows/packaging.yml +++ b/.github/workflows/packaging.yml @@ -58,11 +58,11 @@ jobs: fail-fast: false matrix: os: [ubuntu, macos, windows] - python: ['3.6', '3.9'] + python: ['3.7', '3.10'] include: - - python: '3.6' + - python: '3.7' dist: 'voila*.tar.gz' - - python: '3.9' + - python: '3.10' dist: 'voila*.whl' - os: windows py_cmd: python From 927eed8e050d482792c57eff6afc7c179d8540b4 Mon Sep 17 00:00:00 2001 From: Jeremy Tuloup Date: Mon, 13 Dec 2021 18:37:11 +0100 Subject: [PATCH 3/3] Use `binder-link` action from `maintainer-tools` --- .github/workflows/binder-on-pr.yml | 27 ++++++--------------------- 1 file changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/binder-on-pr.yml b/.github/workflows/binder-on-pr.yml index 36832ef2f..0a6de0a65 100644 --- a/.github/workflows/binder-on-pr.yml +++ b/.github/workflows/binder-on-pr.yml @@ -1,30 +1,15 @@ -# Reference https://mybinder.readthedocs.io/en/latest/howto/gh-actions-badges.html name: Binder Badge on: pull_request_target: types: [opened] -permissions: - pull-requests: - write - jobs: binder: runs-on: ubuntu-latest + permissions: + pull-requests: write steps: - - name: comment on PR with Binder link - uses: actions/github-script@v1 - with: - github-token: ${{secrets.GITHUB_TOKEN}} - script: | - var PR_HEAD_USERREPO = process.env.PR_HEAD_USERREPO; - var PR_HEAD_REF = process.env.PR_HEAD_REF; - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/${PR_HEAD_USERREPO}/${PR_HEAD_REF}?urlpath=voila/tree) :point_left: Try it on binder (branch _${PR_HEAD_USERREPO}/${PR_HEAD_REF}_)` - }) - env: - PR_HEAD_REF: ${{ github.event.pull_request.head.ref }} - PR_HEAD_USERREPO: ${{ github.event.pull_request.head.repo.full_name }} + - uses: jupyterlab/maintainer-tools/.github/actions/binder-link@v1 + with: + github_token: ${{ secrets.github_token }} + url_path: voila/tree \ No newline at end of file