Skip to content

Commit

Permalink
Test the sdist: pip install, verify labextension, pytests
Browse files Browse the repository at this point in the history
caveat: a ~/.cargo/config.toml file is created when testing the
sdist which patches the perspective-python build so that it uses
perspective-server and perspective-client from the local git checkout.
This is so we can test unreleased changes to those crates together.

End users who download sdist artifacts produced in CI between releases
may find they don't build or work correctly, since those sdists will
contain dependencies on release versions of perspective-server and
perspective-client published to crates.io.

Signed-off-by: Tom Jakubowski <tom@prospective.dev>
  • Loading branch information
tomjakubowski committed Oct 31, 2024
1 parent 84c32e5 commit 4043309
Showing 1 changed file with 65 additions and 2 deletions.
67 changes: 65 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ jobs:
# /` | | /|
# `--' ' `-'
#
build_and_test_juptyerlab:
build_and_test_jupyterlab:
needs: [build_js, build_python]
runs-on: ${{ matrix.os }}
strategy:
Expand Down Expand Up @@ -646,6 +646,69 @@ jobs:
PACKAGE: "perspective-python"
# PSP_USE_CCACHE: 1

test_python_sdist:
needs: [build_and_test_jupyterlab]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- ubuntu-22.04
arch:
- x86_64
python-version:
- 3.9
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Config
id: config-step
uses: ./.github/actions/config

- name: Initialize Build
uses: ./.github/actions/install-deps
with:
rust: "true"
cpp: "true"
python: "true"
javascript: "false"
skip_cache: ${{ steps.config-step.outputs.SKIP_CACHE }}

- uses: actions/download-artifact@v4
with:
name: perspective-metadata
path: rust/

- uses: actions/download-artifact@v4
with:
name: perspective-python-sdist

- name: Set up global perspective-server and perspective-client path overrides
# this makes it so the sdist is tested against unreleased changes
# made to perspective-client and perspective-server
run: |
mkdir -p $HOME/.cargo
cat > $HOME/.cargo/config.toml <<EOF
[patch.crates-io]
perspective-client = { path = "$PWD/rust/perspective-client" }
perspective-server = { path = "$PWD/rust/perspective-server" }
EOF
- name: Install perspective-python sdist
run: python -m pip install -vv ./perspective*.tar.gz

- name: Verify labextension
run: |
jupyter labextension list --debug
jupyter labextension list 2>&1 | grep '@finos/perspective-jupyterlab'
- name: Run import test
run: python -c 'import perspective'

- name: Run pytests
run: pytest -v --pyargs 'perspective.tests'

# ,-,---. . .
# '|___/ ,-. ,-. ,-. |-. ,-,-. ,-. ,-. | ,
# ,| \ |-' | | | | | | | | ,-| | |<
Expand Down Expand Up @@ -765,7 +828,7 @@ jobs:
publish:
needs:
[
build_and_test_juptyerlab,
build_and_test_jupyterlab,
test_python,
test_js,
benchmark_js,
Expand Down

0 comments on commit 4043309

Please sign in to comment.