-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP [Docs] Add docs on version workflows
Signed-off-by: Tom Cowland <[email protected]>
- Loading branch information
1 parent
5bbac62
commit 6d92457
Showing
9 changed files
with
758 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# Copyright 2023 The Foundry Visionmongers Ltd | ||
|
||
name: Examples | ||
on: | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-notebooks: | ||
name: "Build Notebooks ${{ matrix.os }} python-${{ matrix.python }}" | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["windows-latest", "ubuntu-latest", "macos-latest"] | ||
python: ["3.7", "3.9", "3.10"] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python }} | ||
- run: | | ||
python -m pip install . | ||
python -m pip install -r examples/resources/requirements.txt | ||
- name: Build Notebooks | ||
run: jupyter nbconvert --to html --execute examples/versioning.ipynb |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.egg-info | ||
.ipynb_checkpoints |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import json | ||
|
||
from IPython.display import display | ||
from PIL import Image | ||
from urllib.parse import urlparse, unquote | ||
|
||
def print_traits_data(data): | ||
""" | ||
TraitsData objects arent readily convertable to a dict, or printable | ||
at present. This is a little helper to aid the display of OpenAssetIO | ||
data in the context of a notebook. It prints the traits and their | ||
properties using pretty json formatting. | ||
""" | ||
as_dict = { | ||
trait_id: { | ||
property_key: data.getTraitProperty(trait_id, property_key) | ||
for property_key in data.traitPropertyKeys(trait_id) | ||
} | ||
for trait_id in data.traitSet() | ||
} | ||
print(json.dumps(as_dict, indent=4, sort_keys=True)) | ||
|
||
def display_image(url): | ||
""" | ||
Displays an image in the notebook output. | ||
""" | ||
url_parts = urlparse(url) | ||
image = Image.open(unquote(url_parts.path)) | ||
display(image) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
jupyter | ||
openassetio>=v1.0.0b1rev0 | ||
openassetio-manager-bal>=v1.0.0a13 | ||
openassetio-mediacreation | ||
Pillow |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"managementPolicy": { | ||
"read": { | ||
"default": { | ||
"openassetio-mediacreation:managementPolicy.Managed": {}, | ||
"openassetio-mediacreation:content.LocatableContent": {} | ||
} | ||
}, | ||
"write": { | ||
"default": { | ||
"openassetio-mediacreation:managementPolicy.Managed": {}, | ||
"openassetio-mediacreation:content.LocatableContent": {} | ||
} | ||
} | ||
}, | ||
"entities": { | ||
"project_artwork/logos/openassetio": { | ||
"versions": [ | ||
{ | ||
"traits": { | ||
"openassetio-mediacreation:identity.DisplayName": { | ||
"name": "The OpenAssetOI logo", | ||
"qualifiedName": "logos / openassetio / v1" | ||
}, | ||
"openassetio-mediacreation:content.LocatableContent": { | ||
"location": "file:///${bal_library_dir}/logo.jpg" | ||
} | ||
} | ||
}, | ||
{ | ||
"traits": { | ||
"openassetio-mediacreation:identity.DisplayName": { | ||
"name": "The OpenAssetIO logo", | ||
"qualifiedName": "logos / openassetio / v2" | ||
}, | ||
"openassetio-mediacreation:content.LocatableContent": { | ||
"location": "file:///${bal_library_dir}/logo_revised.jpg" | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[manager] | ||
identifier = "org.openassetio.examples.manager.bal" | ||
|
||
[manager.settings] | ||
library_path = "${config_dir}/bal_database.json" |
Oops, something went wrong.