Skip to content

Comments

Build: adding support for distribution via Python package#133

Merged
timlehr merged 5 commits intoOpenTimelineIO:mainfrom
timlehr:tlehr/pythonPackage
Oct 9, 2025
Merged

Build: adding support for distribution via Python package#133
timlehr merged 5 commits intoOpenTimelineIO:mainfrom
timlehr:tlehr/pythonPackage

Conversation

@timlehr
Copy link
Collaborator

@timlehr timlehr commented Sep 26, 2025

Feature

This adds support for building and distributing Raven as a Python package. While this might seem a bit odd given that Raven currently doesn't have any Python dependencies, it has some distinct advantages:

  • easily installed using pip just like the other OTIO repos
  • tools like UV will enable running Raven with a single command (no cloning needed) once we publish it to PyPI
# clone the code
git clone --recursive https://github.com/OpenTimelineIO/raven.git
cd raven

# run Raven using UV from local code
uv run --no-editable raven example.otio

# build wheel using UV (wheel file will be in ./dist)
uv build # add '--python <python_version>' to build for a specific Python version

# run Raven directly off PyPi
uvx opentimelineio-raven raven example.otio

Other Changes

  • Raven version is now read from VERSION.txt instead of being hardcoded into CmakeList

Next steps

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>
@timlehr timlehr requested a review from jminor September 26, 2025 00:34
@timlehr timlehr marked this pull request as draft September 26, 2025 00:40
@timlehr timlehr force-pushed the tlehr/pythonPackage branch from c4a1024 to 75f1ebc Compare September 26, 2025 04:10
Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Drop old Python versions

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Fixing Python Install

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Adding macOS wheels

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Fix Python install

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Fix Python versions

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Use managed Python

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Added Sdist artifact

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>

Build: Linux Wheels on CI

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>
@timlehr timlehr force-pushed the tlehr/pythonPackage branch from bb170a5 to 544ad4a Compare September 26, 2025 07:04
Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>
@timlehr timlehr force-pushed the tlehr/pythonPackage branch from 1ae1751 to 7d88b2c Compare September 26, 2025 07:40
@timlehr timlehr self-assigned this Sep 26, 2025
@timlehr timlehr requested a review from apetrynet September 26, 2025 07:43
@timlehr timlehr marked this pull request as ready for review September 26, 2025 07:43
Copy link
Member

@apetrynet apetrynet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to be awesome!
Sadly, I was unable to build on my machine as I have gtk4+ only, but I trust the CI is a good indication of it working.
Left a couple of comments

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This setup differs a bit from the adapters. I think the token approach is deprecated for instance.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't been able to test this at all. I mostly copied it over from the core repo - I was contemplating using uv publish here, but somebody has to give me an intro into how we test this stuff for the OTIO org.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I need to attend that intro myself.
However I think using uv publish will need the same authentication method.
Perhaps setting up this workflow should be its own PR where we can set it up correctly?

Being able to run raven via uv like described in the README.md is a good first step

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, do you want me to remove the publish.yaml or still keep it for now?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm leaning towards removing it as it needs a couple of iterations to get working correctly.
In this case we should submit a ticket targeted towards getting publishing up and running.

Just remember to adjust the readme if we go this route.

The PR still has a lot of value as it lowers the entry "cost" for getting Raven running.

What do you think @jminor?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed and opened issue #135

@timlehr
Copy link
Collaborator Author

timlehr commented Sep 26, 2025

@apetrynet can you build the regular way via cmake on your machine? I tried to make almost no changes to the build steps itself and just pipe the builds through to Python. The Linux pipeline requires some dependencies - I wonder if we need to add your setup to the matrix, if it's a popular configuration?

@apetrynet
Copy link
Member

I haven't tried building manually, but it looks like the cmake files indicate gtk3
I'm on Debian Trixie which is gtk4.

I'm not sure what distros like Rocky 9 use? But if they also provide gnome desktop in the 40+ range we should look into upping the gtk requirement.

@timlehr
Copy link
Collaborator Author

timlehr commented Sep 26, 2025

Yeah, maybe we make that a separate issue? Seems like there is some investigation to be done.

Removing this, to be added and configured in a separate PR.

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>
@timlehr timlehr force-pushed the tlehr/pythonPackage branch from c1ad474 to 6060ffa Compare September 27, 2025 21:31
Copy link
Member

@apetrynet apetrynet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but someone able to build the package should perhaps have a look before we hit merge?

Signed-off-by: Tim Lehr <tim.lehr@disneyanimation.com>
strategy:
matrix:
python-version: ["3.9"]
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest ]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-latest ]
os: [ ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-14, macos-latest ]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I didn't see this one up here before pressing merge ... I will add it to the publish PR.

Copy link
Member

@jminor jminor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great. I'm checking with ASWF regarding the policies about release artifacts vs distribution.

Copy link
Member

@jminor jminor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASWF representative says we can go ahead with this, and publish to PyPI as well.

@timlehr timlehr merged commit bd2e83a into OpenTimelineIO:main Oct 9, 2025
12 checks passed
@timlehr timlehr deleted the tlehr/pythonPackage branch October 9, 2025 20:01
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.

3 participants