run-clang-format
run-clang-format copied to clipboard
Adding run-clang-format to PyPI
First of all, thanks for creating this great wrapper around clang-format, it makes running it locally and on CI much more easy and useful!
Now that clang-format is packaged in PyPI (https://pypi.org/project/clang-format/) would you consider adding this package to PyPI and configuring clang-format
as a dependency? That way users could just pip install run-clang-format
(or even better using pipx we could pipx install run-clang-format
!), and be able to use this tool very easily.
Hello,
See my previous answer here:
- https://github.com/Sarcasm/run-clang-format/issues/6#issuecomment-465789379
Thanks for the quick response @Sarcasm!
From my point of view, as a user, it's a lot nicer to be able to be able install this as part as any other Python dependencies and run it like any other tool (specially since CMake and Ninja are also in PyPI). Even more so in a CI environment, where we can easily get everything installer with a single pip
command. It also means it's easier to see if there are new releases and update when appropriate. Vendoring tools usually end up with rotting files, but to be fair, that is the users' responsability.
And it is true, that packing it moves some of that burden from the users to the maintainer.
I've be happy to submit a PR to sort out the packaging, and to configure GitHub actions to submit it to PyPI via github tag if that helps? That way the only thing needed is to set up the PyPI keys via GitHub secrets and push a git tag to get the automation going.
If you still prefer not to package it, would you be against somebody else packaging it and publishing to PyPI? Of course, I'd make sure the description clearly gives the proper attribution an indicates all packaing issues should be directed to a different issue tracker.
It also means it's easier to see if there are new releases and update when appropriate. Vendoring tools usually end up with rotting files, but to be fair, that is the users' responsability.
The thing is that run-clang-format.py is deliberately dependency-less (just Python stdlib and clang-format). And it's mostly one use case, running clang-format on the project. Eventually, clang-format changes, and you want the new feature, then you can lookup run-clang-format for an update. But you won't gain or lose much lagging behind. Upgrading clang-format needs to be somewhat controlled, output can varies from version to versions, so blindly updating may not be advised IMHO. run-clang-format.py a single text file, so usually easy to embed in a VCS-tracked project.
Thinking about it, if I really wanted to package it, I would consider upstreaming it to the llvm project, like run-clang-tidy
is (the source of inspiration for run-clang-format).
That way, the clang-format pip package could also distribute it then, I think.
That said, I can consider a PR for a PyPI package via Github actions and I would not be offended by an independent pip package either.