python-clang icon indicating copy to clipboard operation
python-clang copied to clipboard

(updated) Trusted publishing directly from the LLVM CI

Open nightlark opened this issue 10 months ago • 2 comments

Hi @trolldbois - I noticed there have been a few new versions of clang since the last release on PyPI for the clang bindings. It would be great to get wheels for clang 18 and 19 uploaded. I expect clang 20 will also be coming out this upcoming March.

Correct me if I'm off, but it seems like you might not be as active these days on GitHub as in the past. If you're open to adding another maintainer (which would ostensibly be good so all of the burden doesn't fall on a single person, or point of failure), then I'd like to help out if you can add me to the project on GitHub and PyPI (username: rmast). The gist of what I'm thinking for making updated releases a bit more timely can be seen in PR #20.

Perhaps we can see if the workflows for publishing updated wheels would be accepted by the upstream LLVM project to further help increase the odds of new versions being released in a timely manner.

nightlark avatar Feb 04 '25 07:02 nightlark

The PR that adds a pyproject.toml file for building a wheel from a copy of the LLVM source code/repository is https://github.com/llvm/llvm-project/pull/125806 -- if you want to take a look and leave any review comments that might be good, at the moment the challenge seems to be getting reviewers who have some familiarity with Python packaging.

nightlark avatar Feb 17 '25 22:02 nightlark

I left a comment over there, to confirm I'm happy to integrate with the upstream LLVM github CI whenever they are ready

trolldbois avatar Mar 05 '25 21:03 trolldbois

The owners/maintainers of the LLVM org on PyPI are willing to take ownership. There's some discussion and their PyPI user names in this thread: https://discourse.llvm.org/t/moving-projects-into-the-llvm-org-on-pypi/88868/2

nightlark avatar Nov 15 '25 04:11 nightlark

@trolldbois the PRs for moving over to the LLVM github CI are in review, can you transfer ownership to @boomanaiden154 or @stellar so they can move it into the LLVM PyPI org?

nightlark avatar Nov 15 '25 21:11 nightlark

What exactly is the difference between this package and the libclang package? It seems like they both publish python bindings.

boomanaiden154 avatar Nov 15 '25 21:11 boomanaiden154

The clang package is just the Python binding files, the libclang package adds platform specific wheels with precompiled libraries. In general it seems people like the convenience of libclang as a dependency because it generally just works -- what I'm thinking for merging them into the LLVM monorepo is:

  • the clang package continues to just publish the pure Python bindings
  • the libclang package gets changed to use the clang package as a dependency to supply the pure Python bindings rather than providing a copy of its own, and instead becomes a way people can "opt-in" if they want the precompiled native libraries

nightlark avatar Nov 15 '25 21:11 nightlark

So they're both the libclang python bindings, it's just that one (the clang package) does not ship the actual native artifacts to actually be useable? How are you typically expected to use it? A system provided libclang shared object?

boomanaiden154 avatar Nov 17 '25 04:11 boomanaiden154

LLVM invited to pypi project

trolldbois avatar Dec 18 '25 22:12 trolldbois

So they're both the libclang python bindings, it's just that one (the clang package) does not ship the actual native artifacts to actually be useable? How are you typically expected to use it? A system provided libclang shared object?

Yes, libclang should be installed with the system's package management system. This avoid the problem of have to trust binary libraries stored & distributed through pypi.

trolldbois avatar Dec 18 '25 22:12 trolldbois