From b2c830e7201a7a553067b4125bdd6d0d22cc76dc Mon Sep 17 00:00:00 2001 From: David Feltell Date: Fri, 30 Aug 2024 10:50:35 +0100 Subject: [PATCH] fixup! [Docs] Add hybrid plugin system notebook Update CI to execute notebok Signed-off-by: David Feltell --- .github/build_openassetio/action.yml | 5 ++-- .github/workflows/examples.yml | 40 +++++++++++++++++++++++++- examples/hybrid_plugin_system.ipynb | 43 ++++++++++++++++------------ examples/resources/requirements.txt | 4 +-- 4 files changed, 69 insertions(+), 23 deletions(-) diff --git a/.github/build_openassetio/action.yml b/.github/build_openassetio/action.yml index 344ffff..5f28b2c 100644 --- a/.github/build_openassetio/action.yml +++ b/.github/build_openassetio/action.yml @@ -1,5 +1,5 @@ # SPDX-License-Identifier: Apache-2.0 -# Copyright 2023 The Foundry Visionmongers Ltd +# Copyright 2023-2024 The Foundry Visionmongers Ltd # Composite action for reuse within other workflows. # Builds OpenAssetIO. @@ -15,13 +15,14 @@ runs: with: repository: OpenAssetIO/OpenAssetIO path: openassetio-checkout + ref: v1.0.0-rc.1.0 - name: Build OpenAssetIO shell: bash run: | cd openassetio-checkout mkdir build - cmake -G Ninja -S . -B build + cmake -G Ninja -S . -B build -DOPENASSETIO_ENABLE_SIMPLECPPMANAGER=ON cmake --build build cmake --install build - uses: actions/upload-artifact@v3 diff --git a/.github/workflows/examples.yml b/.github/workflows/examples.yml index 23777ca..5dbd278 100644 --- a/.github/workflows/examples.yml +++ b/.github/workflows/examples.yml @@ -18,6 +18,9 @@ jobs: matrix: os: ["windows-2022", "ubuntu-22.04", "macos-13"] python: ["3.10", "3.11"] + defaults: + run: + shell: bash steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -28,4 +31,39 @@ jobs: python -m pip install . python -m pip install -r examples/resources/requirements.txt - name: Test Notebooks - run: jupyter nbconvert --to html --execute examples/*.ipynb + # Execute all the notebooks apart from the Hybrid Plugin System, + # which requires a build of SimpleCppManager + run: > + find examples -maxdepth 1 -name "*.ipynb" + ! -name "hybrid_plugin_system.ipynb" + -exec jupyter nbconvert --to html --execute {} \; + + test-cpp-notebooks: + # A special job just for the Hybrid Plugin System because it needs a + # build of SimpleCppManager. Use the OpenAssetIO Docker container to + # get a build. More notebooks may be added here in the future, if + # they need a C++ build (as opposed to Python `pip install`) of + # OpenAssetIO. + name: Test Hybrid Plugin System notebook + runs-on: ubuntu-latest + container: + image: ghcr.io/openassetio/openassetio-build + steps: + - uses: actions/checkout@v3 + - name: Install Dependencies + run: | + python -m pip install . + python -m pip install -r examples/resources/requirements.txt + + - name: Build SimpleCppManager + uses: ./.github/build_openassetio + + - name: Copy SimpleCppManager to expected location for notebook + run: > + cp openassetio-checkout/build/dist/SimpleCppManager.so + examples/resources/hybrid_plugin_system/SimpleCppManager/ + + - name: Test notebook + run: jupyter nbconvert --to html --execute examples/hybrid_plugin_system.ipynb + + diff --git a/examples/hybrid_plugin_system.ipynb b/examples/hybrid_plugin_system.ipynb index 33cd4d5..8d1cb78 100644 --- a/examples/hybrid_plugin_system.ipynb +++ b/examples/hybrid_plugin_system.ipynb @@ -45,8 +45,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:11.933821Z", - "start_time": "2024-07-29T08:53:11.870536Z" + "end_time": "2024-08-29T16:33:45.949575Z", + "start_time": "2024-08-29T16:33:45.918489Z" } }, "cell_type": "code", @@ -102,8 +102,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:11.937984Z", - "start_time": "2024-07-29T08:53:11.935275Z" + "end_time": "2024-08-29T16:33:45.964636Z", + "start_time": "2024-08-29T16:33:45.962034Z" } }, "cell_type": "code", @@ -128,8 +128,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:11.946555Z", - "start_time": "2024-07-29T08:53:11.939169Z" + "end_time": "2024-08-29T16:33:46.064153Z", + "start_time": "2024-08-29T16:33:46.061796Z" } }, "cell_type": "code", @@ -154,8 +154,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:11.983827Z", - "start_time": "2024-07-29T08:53:11.947864Z" + "end_time": "2024-08-29T16:33:46.125305Z", + "start_time": "2024-08-29T16:33:46.108742Z" } }, "cell_type": "code", @@ -198,6 +198,13 @@ "metadata": {}, "output_type": "display_data" }, + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001B[0;33m warning: PythonPluginSystem: Use of top-level 'plugin' variable is deprecated, use `openassetioPlugin` instead. /home/dave/workspace/cloud/assetapi/OpenAssetIO-MediaCreation/.venv-conda-vfx24/lib/python3.11/site-packages/openassetio_manager_bal/__init__.py\u001B[0m\n" + ] + }, { "data": { "text/markdown": "> **Result:**\n> `Python plugin error: Manager implementation for 'org.openassetio.examples.manager.hybrid' does not support the required capabilities: entityReferenceIdentification`" @@ -227,8 +234,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:11.989384Z", - "start_time": "2024-07-29T08:53:11.985075Z" + "end_time": "2024-08-29T16:33:46.311240Z", + "start_time": "2024-08-29T16:33:46.307840Z" } }, "cell_type": "code", @@ -258,8 +265,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:11.995639Z", - "start_time": "2024-07-29T08:53:11.990896Z" + "end_time": "2024-08-29T16:33:46.369557Z", + "start_time": "2024-08-29T16:33:46.366356Z" } }, "cell_type": "code", @@ -300,8 +307,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:12.000903Z", - "start_time": "2024-07-29T08:53:11.997023Z" + "end_time": "2024-08-29T16:33:46.420316Z", + "start_time": "2024-08-29T16:33:46.417229Z" } }, "cell_type": "code", @@ -317,7 +324,7 @@ "outputs": [ { "data": { - "text/markdown": "> **Result:**\n> `{'openassetio-mediacreation:usage.Entity', 'openassetio-mediacreation:identity.DisplayName', 'openassetio-mediacreation:twoDimensional.Image'}`" + "text/markdown": "> **Result:**\n> `{'openassetio-mediacreation:usage.Entity', 'openassetio-mediacreation:twoDimensional.Image', 'openassetio-mediacreation:identity.DisplayName'}`" }, "metadata": {}, "output_type": "display_data" @@ -334,8 +341,8 @@ { "metadata": { "ExecuteTime": { - "end_time": "2024-07-29T08:53:12.017865Z", - "start_time": "2024-07-29T08:53:12.001978Z" + "end_time": "2024-08-29T16:33:46.482571Z", + "start_time": "2024-08-29T16:33:46.468873Z" } }, "cell_type": "code", @@ -357,7 +364,7 @@ "outputs": [ { "data": { - "text/markdown": "> **Result:**\n> `{'openassetio-mediacreation:twoDimensional.Image', 'openassetio-mediacreation:lifecycle.Version', 'openassetio-mediacreation:identity.DisplayName', 'openassetio-mediacreation:timeDomain.FrameRanged', 'openassetio-mediacreation:usage.Entity', 'openassetio-mediacreation:content.LocatableContent'}`" + "text/markdown": "> **Result:**\n> `{'openassetio-mediacreation:content.LocatableContent', 'openassetio-mediacreation:identity.DisplayName', 'openassetio-mediacreation:twoDimensional.Image', 'openassetio-mediacreation:lifecycle.Version', 'openassetio-mediacreation:usage.Entity', 'openassetio-mediacreation:timeDomain.FrameRanged'}`" }, "metadata": {}, "output_type": "display_data" diff --git a/examples/resources/requirements.txt b/examples/resources/requirements.txt index 4342f3a..fab8fa3 100644 --- a/examples/resources/requirements.txt +++ b/examples/resources/requirements.txt @@ -1,5 +1,5 @@ jupyter -openassetio>=v1.0.0b2rev0 -openassetio-manager-bal>=v1.0.0a14 +openassetio>=v1.0.0rc1.rev0 +openassetio-manager-bal>=v1.0.0b1.rev0 openassetio-mediacreation Pillow