Skip to content

Commit b338547

Browse files
Merge pull request #11 from elliotcmorris/work/10-beta1
[Core] Update to beta 1 support
2 parents 8c27c78 + fbaca88 commit b338547

3 files changed

Lines changed: 26 additions & 3 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,23 @@ jobs:
2727
python -m pytest -v ./tests
2828
2929
test:
30-
name: ${{ matrix.os }} ${{ matrix.python }}
30+
name: ${{ matrix.os }} ${{ matrix.python }} ${{ matrix.openassetio }}
3131
runs-on: ${{ matrix.os }}
3232
strategy:
3333
fail-fast: false
3434
matrix:
3535
os: ["windows-latest", "ubuntu-latest", "macos-latest"]
3636
python: ["3.7", "3.9", "3.10"]
37+
# We use a deprecation for demonstrative purposes, so test
38+
# before/after
39+
openassetio: ["\"openassetio==1.0.0a14\"", "\"openassetio>=1.0.0b1.rev0\""]
3740
steps:
3841
- uses: actions/checkout@v4
3942
- uses: actions/setup-python@v4
4043
with:
4144
python-version: ${{ matrix.python }}
4245
- run: |
46+
python -m pip install ${{ matrix.openassetio }}
4347
python -m pip install .
4448
python -m pip install -r tests/requirements.txt
4549
python -m pytest -v ./tests

plugin/my_asset_manager/MyAssetManagerInterface.py

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@
1111
# the this class. See the notes under the "Initialization" section of:
1212
# https://openassetio.github.io/OpenAssetIO/classopenassetio_1_1v1_1_1manager_api_1_1_manager_interface.html#details (pylint: disable=line-too-long)
1313
# As such, any expensive module imports should be deferred.
14-
from openassetio import constants, BatchElementError, TraitsData
14+
from openassetio import constants, TraitsData, BatchElementError
15+
16+
# TraitsData and BatchElementError got moved with a deprecation. If you
17+
# don't need to support versions prior to beta 1.0, you should use the
18+
# below two imports instead.
19+
# from openassetio.traits import TraitsData
20+
# from openassetio.errors import BatchElementError
1521
from openassetio.access import PolicyAccess, ResolveAccess
1622
from openassetio.managerApi import ManagerInterface
1723
from openassetio_mediacreation.traits.content import LocatableContentTrait
@@ -53,6 +59,19 @@ def initialize(self, managerSettings, hostSession):
5359
def displayName(self):
5460
return "My Asset Manager"
5561

62+
def hasCapability(self, capability):
63+
# Declare what sort of capabilities your manger fulfils.
64+
# EntityReferenceIdentification and ManagementPolicyQueries
65+
# are mandatory.
66+
if capability in (
67+
ManagerInterface.Capability.kEntityReferenceIdentification,
68+
ManagerInterface.Capability.kManagementPolicyQueries,
69+
ManagerInterface.Capability.kResolution,
70+
):
71+
return True
72+
73+
return False
74+
5675
def info(self):
5776
# This hint allows the API middleware to short-circuit calls to
5877
# `isEntityReferenceString` using string prefix comparisons. If

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name = "my_asset_manager"
66
version = "1.0.0"
77
requires-python = ">=3.7"
88
dependencies = [
9-
"openassetio == 1.0.0a14",
9+
"openassetio >= 1.0.0a14",
1010
"openassetio-mediacreation == 1.0.0a7"
1111
]
1212

0 commit comments

Comments
 (0)