-
Notifications
You must be signed in to change notification settings - Fork 659
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 python packaging support #1377
Add python packaging support #1377
Conversation
989a226
to
e1b54b2
Compare
Hey @peytondmurray thanks a lot for your work on this, this is looking great! I need to spend a bit more time looking at what you have here but here's some initial comments:
I do like the idea of the Finally we can absolutely credit Alex for their work! In case I haven't mentioned, the TSC have weekly catch-ups every Tuesday (10:00am to 11:00am (UTC-07:00)). They're minuted, but informal and open to anyone should you or Alex wish to attend and discuss anything here. Reminders are posted here: https://lists.aswf.io/g/openvdb-dev/topics. Either way I will feedback your progress, thanks again! |
@Idclip Thanks for the info - I think based on your feedback I'll try once more to build wheels using
OpenVDB itself depends on GCC>=6.3.1.
Most large PyPI projects publish both wheels and sdists; the wheels are faster and smaller to install, but the sdists have better compatibility because the compilation step happens at install time.
Hey, thanks for the invite! I saw that these meetings were on the calendar, but wasn't sure whether anyone would have questions about all this if I showed up. I'm traveling next week, but I think I might be able to make the meeting anyway. Even if nobody has any questions about this packaging stuff I'll come and say hello. |
c232888
to
fed266e
Compare
Okay, so I spent some time fiddling about getting wheels to build on Looks like the DCO workflow has failed, but I've done |
Just glancing through the error message (at the bottom):
Great work you're doing there, pip support is a much awaited relief to the (in the past) tedious installation process of |
fed266e
to
3e95364
Compare
Ahh 😅 sorry! @Idclip Would it be possible to retrigger CI? |
Signed-off-by: pdmurray <peynmurray@gmail.com>
Signed-off-by: pdmurray <peynmurray@gmail.com>
Signed-off-by: pdmurray <peynmurray@gmail.com>
Signed-off-by: pdmurray <peynmurray@gmail.com>
e2f3432
to
270ba78
Compare
@peytondmurray have you beem able to address @JeanChristopheMorinPerso's lastest comments? We still need a maintainer approval to run the github action workflows for this PR. |
Signed-off-by: pdmurray <peynmurray@gmail.com>
ac8575a
to
9fa446a
Compare
@AcademySoftwareFoundation/openvdb |
Signed-off-by: pdmurray <peynmurray@gmail.com>
758a44e
to
62ab659
Compare
@jdumas Yep, I think the comments above are addressed. |
@Idclip Can you re-trigger CI please? |
Worflow flie seems to be invalid: https://github.com/AcademySoftwareFoundation/openvdb/actions/runs/5639306194/workflow |
It looks like the github action file is missing a |
@peytondmurray sorry to ping you again, but would you be able to update your github action file to correct the syntax by adding the |
Yep! Sorry, the last notification got buried, I'll do it now! |
Signed-off-by: pdmurray <peynmurray@gmail.com>
Argh it looks like it needs approval again from a maintainer to run :/. Hope it works this time. |
Yeah, I wish I'd made a smaller/easier to merge PR before submitting this one so we didn't have to wait for the workflow checks - I think they're only guarded against first time contributors. Thanks for your patience! |
I'm not sure that it needs to be approved again for every commit of the same PR though, that seems a bit too much. |
Not sure we can change this (?) but I'll try to remember to press the button when I see notifications |
Hey folks, it's been a while since I updated this PR. At this point I'm open to PRs against this branch, or if someone wants to take over pushing this forward. At the moment I've been preoccupied with other work, and don't have much time to press this forward much more. What's the best way to tie this up? I'd be happy to do something here if it's small, but otherwise would it be best to close it out? I'm not sure how much need there is for this right now. I'd also like to point out that meson-python has been really useful in a couple of projects that I've worked on in building compiled python extensions; it's much easier to deal with than cmake IMO. It might be worth looking into if fiddling with cmake is a challenge here. |
I don't think cmake is causing any unusual troubles here. Moving to another build system would be a huge task. |
@peytondmurray could you give me write access to your fork? I don't have a lot of time right now, but I'd be happy to contribute when I can. One thing that makes it slow to iterate on this PR is that each commit requires approval from a maintainer before running GitHub actions. However, I think it only does that for first-time contributors, and I already have existing contributions to this repo, so it's possible that any of my commit triggers GitHub action right away (haven't been able to test that on @peytondmurray's branch since I don't have write access to it). |
Invite sent! |
Summary
This PR adds python packaging support, allowing the python OpenVDB bindings to be installed with
pip
. It also includes github actions to automatically publish releases to the Python Package Index (PyPI). See #161 for original discussion.Changes
pyproject.toml
, which specifies build-time dependencies for the python package.setup.py
, which makespyopenvdb
installable bypip
, and specifies the python side of the build recipe.Actions->Build and Release Python Bindings to PyPI->Run Workflow
and providing a branch and ref to build.Additional Info
I explored a couple of options for generating binary python package distributions (wheels), but eventually opted only to generate source distributions (sdists). Here's what I tried:
manylinux2014
because it's based on CentOS 7, which only has boost 1.53 available in the official repositories, so we'd have to build it from scratchmanylinux_2_24
because it's based on Debian 9, and uses GCC 6.3 which can't build our dependencies.I eventually gave up on cibuildwheel to explore other options.
2. Using
ubuntu:22.04
to build wheels for Python 3.8, 3.9, and 3.10 seems like a good idea, and in fact I think it should in principle work - except we still need to build OpenVDB from source, which takes long enough on the github actions runners that the job times out.So for this reason that I think it is best just to release an sdist to PyPI, which means that when a user installs the package with
pip install pyopenvdb
,pip
will trigger a build of the shared library and copy it to the appropriatesite-packages
. sdists are commonly uploaded as "fallback" distributions on PyPI anyway, because they should be compatible with any system that has the appropriate dependencies, and are compiled at install time rather than at the time the package is published.Update 2023-02-03
I've reworked this PR so that it now works with the new pybind11 bindings.
Changes
test.pypi.org
(if aworkflow_dispatch
event is used ad the appropriate checkbox is clicked) or by default topypi.org
, the main python package index. Publishing requires the presence of a github secret with a PYPI token, namedPYPI_API_TOKEN
. If publishing totest.pypi.org
, the secret that is used should be calledTEST_PYPI_API_TOKEN
I can meet to help out with this if the process is unclear. When a new release is made, this workflow will automatically build and publish the release to PYPI.pyproject.toml
before publishing :/ hopefully this feature gets added to the build backend soon.openvdb
package name, as discussed before. To install, you'd just dopip install openvdb
and to use them you'd doimport openvdb
.Todo