Skip to content

Commit c96b92a

Browse files
committed
[Docs] Add Jupyter notebook covering version workflows
Adds a Jupyter notebook that demonstrates the traits and specifications that can be used to introspect entity versioning information and relationships. It includes a CI task that executes and renders the notebook so we can ensure that the included code works. We opted not to `!python -m pip install` dependecies in the notebook itself to avoid polluting the parent Python environment. The included `examples/resources/requirements.txt` installs the needed pre-requisites. Opted to share one requirements file for all notebooks for now to simplify setup. Signed-off-by: Tom Cowland <[email protected]>
1 parent 4f73fb6 commit c96b92a

File tree

10 files changed

+922
-1
lines changed

10 files changed

+922
-1
lines changed

.github/workflows/examples.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
# Copyright 2023 The Foundry Visionmongers Ltd
3+
4+
name: Examples
5+
on:
6+
pull_request:
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test-notebooks:
14+
name: "Test Notebooks ${{ matrix.os }} python-${{ matrix.python }}"
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
20+
python: ["3.7", "3.9", "3.10"]
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: actions/setup-python@v4
24+
with:
25+
python-version: ${{ matrix.python }}
26+
- name: Install Dependencies
27+
run: |
28+
python -m pip install .
29+
python -m pip install -r examples/resources/requirements.txt
30+
- name: Test Notebooks
31+
run: jupyter nbconvert --to html --execute examples/*.ipynb

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
*.egg-info
2+
.ipynb_checkpoints

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# OpenAssetIO-MediaCreation
22

3-
OpenAssetIO extensions for use in Media Creation
3+
A library of OpenAssetIO extensions for use in Media Creation workflows.
44

55
> Note: This repository is currently in a pre-alpha state, and so should
66
> not be used for any production critical applications.
@@ -13,6 +13,26 @@ MediaCreation is an automatically generated Python package,
1313
[openassetio-traitgen](https://github.com/OpenAssetIO/OpenAssetIO-TraitGen)
1414
is used to generate trait implementations based on [traits.yml](traits.yml)
1515

16+
## Examples
17+
18+
Code samples of how the Media Creation Traits and Specifications can be
19+
used in production workflows are available in the [examples](./examples)
20+
directory in form of [Jupyter](https://jupyter.org) notebooks.
21+
22+
When [viewed in GitHub](https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation/tree/main/examples)
23+
they will be fully rendered. They can also be explored locally:
24+
25+
```bash
26+
git clone https://github.com/OpenAssetIO/OpenAssetIO-MediaCreation.git
27+
cd OpenAssetIO-MediaCreation
28+
python -m venv .venv
29+
. ./.venv/bin/activate
30+
python -m pip install .
31+
python -m pip install -r examples/resources/requirements.txt
32+
cd examples
33+
jupyter notebook
34+
```
35+
1636
## Project status
1737

1838
These initial incarnations of traits/specifications serve as

0 commit comments

Comments
 (0)