-
Notifications
You must be signed in to change notification settings - Fork 16
add python CLI bindings #121
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
Conversation
9d78d54
to
f7f3703
Compare
That is pretty sweet. Maybe we can get a homebrew recipe too ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank yoU @kevinjqliu -- do you have any idea how to test this? I feel if we merged this PR the CI would likely not work on our next release but I don't know that for sure
1242c80
to
2d395ca
Compare
This is great @kevinjqliu - thank you ! Btw, do you expect a need for having bindings from the core crate so it's usable as Python library ? Edit: I'll review and test after the long weekend, I will also setup the publishing workflow via PyPi. |
e980ba1
to
e57865e
Compare
I dont see a need right now. Personally, I just wanted to
Sounds good! No rush. Do you have a testpypi account? I can add you to the project in testpypi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the github action run using my fork and published the package to testpypi.
I added both kevinjqliu/tpchgen-rs
and clflushopt/tpchgen-rs
as trusted publishers in testpypi
I think we should merge this PR as is, pointing to testpypi. Run the github action on main, verify that it can publish to testpypi, and then edit the github action to publish to pypi.
7495b5c
to
9643947
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@kevinjqliu I think this is a great idea and will expand the reach of tpchgen a lot.
Unfortuantely I don't have time to help manage / test this, but I think we should just give you the permissions to do it yourself:
[`tpchgen`](https://github.com/clflushopt/tpchgen-rs) is a TPC-H data generator written in rust. Here's more background on its development, https://datafusion.apache.org/blog/2025/04/10/fastest-tpch-generator/ `maturin` was used to distribute the rust binary as python script, using [its `bin` bindings feature](https://www.maturin.rs/bindings#bin), with minimal code change (See clflushopt/tpchgen-rs#121) The rust binary cli can now be pip installed, ``` pip install tpchgen-cli tpchgen-cli -h ``` Took me a while to figure out that `maturin` had first-class support for something like this. My first attempt was to export the cli functions manually (See clflushopt/tpchgen-rs#119). Because of this, I think this use case is a great example to add. (Following #2529 as example PR)
Closes #113
This PR creates the
tpchgen-cli
pypi package usingmaturin
and exposes the rust binary as python executable.It also adds the
.github/workflows/tpchgen-cli-publish-pypi.yml
Github Action to publish to pypi on new release.This PR allows
tpchgen-cli
to be installed via pip and used like so:.github/workflows/tpchgen-cli-publish-pypi.yml
is generated usingmaturin generate-ci github
and then edited.The github action is tested using my fork and published the package to testpypi.
Try it out:
I added both

kevinjqliu/tpchgen-rs
andclflushopt/tpchgen-rs
as trusted publishers in testpypiI think we should merge this PR as is, pointing to testpypi. Run the github action on
main
, verify that it can publish to testpypi, and then edit the github action to publish to pypi.Dev Env
Setup
Develop
Run