Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for plugin version numbers #1585

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

apetrynet
Copy link
Contributor

As part of the discussion around issue #1386 it has come up that it would be good to be able to check the version of a loaded plugin.
This PR adds a version field to the PythonPlugin class. The version number is defined in the manifest.

otiopluginfo displays the version number next to the adapter name. For plugins that don't contain the version key "unknown" is listed.

To my knowledge, this PR does not break backwards compatibility so I left the PythonPlugin schema version number as is. Please comment with your thoughts on this.

Example version definition in manifest:

{
            "OTIO_SCHEMA" : "Adapter.1",
            "name" : "svg",
            "version": "1.0.0",
            "filepath" : "svg.py",
            "suffixes" : ["svg"]
        }

Example output from otiopluginfo:

[...]
adapters:
  cmx_3600 - version: unknown
    doc (short): OpenTimelineIO CMX 3600 EDL Adapter
    path: /home/daniel/Code/OpenTimelineIO/.venv/lib/python3.9/site-packages/opentimelineio/adapters/cmx_3600.py
    from manifest: /home/daniel/Code/OpenTimelineIO/.venv/lib/python3.9/site-packages/opentimelineio/adapters/builtin_adapters.plugin_manifest.json
    explicit supported features:
      read_from_string args: ['input_str', 'rate', 'ignore_timecode_mismatch']
      write_to_string args: ['input_otio', 'rate', 'style', 'reelname_len']
    implicit supported features:
      read_from_file (calls: read_from_string)

  svg - version: 1.0.0
    doc (short): OTIO to SVG Adapter
    path: /home/daniel/Code/OpenTimelineIO/.venv/lib/python3.9/site-packages/opentimelineio/adapters/svg.py
    from manifest: /home/daniel/Code/OpenTimelineIO/.venv/lib/python3.9/site-packages/opentimelineio/adapters/builtin_adapters.plugin_manifest.json
    explicit supported features:
      write_to_string args: ['input_otio', 'width', 'height']


The version number is defined in the manifest.

Signed-off-by: apetrynet <[email protected]>
…gins without version numbers defined in the manifest get "version: unknown"

Signed-off-by: apetrynet <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant