build(packaging): Add pyproject.toml for dapper binary Python wheel packaging#232
build(packaging): Add pyproject.toml for dapper binary Python wheel packaging#232
Conversation
…ackaging (#231) Adds a pyproject.toml file to configure the build system for creating a Python wheel that includes the compiled Rust binary. This enables distribution and installation of the Rust functionality via pip without requiring users to install a rust compiler. Signed-off-by: Ryan Mast <mast9@llnl.gov>
There was a problem hiding this comment.
Pull request overview
This PR adds a pyproject.toml file at the repository root to enable distribution of the Rust-based dapper CLI tool as a Python wheel package via maturin. This complements the existing python/pyproject.toml which packages the dapper-python library, by providing a separate binary distribution mechanism.
Key Changes:
- Configures maturin as the build backend with bin bindings to package the Rust binary
- Defines package metadata for "dapper-bin" with Python >=3.8 requirement
- References the root Cargo.toml manifest to build the dapper binary
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| [project] | ||
| name = "dapper-bin" | ||
| description = "pip installable dapper binaries" |
There was a problem hiding this comment.
[nitpick] The description should capitalize "pip" to "Pip" or use it with a hyphen ("pip-installable") for better grammar and consistency with common Python packaging conventions.
| description = "pip installable dapper binaries" | |
| description = "pip-installable dapper binaries" |
| classifiers = [ | ||
| "Programming Language :: Python :: 3", | ||
| "Operating System :: MacOS", | ||
| "Operating System :: Microsoft :: Windows", | ||
| "Operating System :: POSIX :: Linux", | ||
| "Intended Audience :: Developers", | ||
| "Intended Audience :: Science/Research", | ||
| "Topic :: Database", | ||
| "Topic :: Security", | ||
| "Topic :: Utilities", | ||
| ] |
There was a problem hiding this comment.
[nitpick] The classifiers list is missing a license classifier. Consider adding "License :: OSI Approved :: MIT License" to be consistent with the license field and provide better discoverability on PyPI.
| # Point maturin at the crate manifest in the repo root. | ||
| manifest-path = "Cargo.toml" | ||
| # Name of the exposed module/CLI (sets the wheel name and console script). | ||
| module-name = "dapper" |
There was a problem hiding this comment.
The module-name configuration may not be necessary or appropriate for bindings = "bin". In bin mode, maturin typically derives the binary name from the Cargo.toml package name. If you need to control the binary/script name, verify this is the correct approach for maturin's bin bindings. The mismatch between project.name = "dapper-bin" and module-name = "dapper" may also cause confusion.
| module-name = "dapper" |
| keywords = ["source-code-analysis", "c", "c++", "python", "bash", "tree-sitter", "rust"] | ||
| classifiers = [ | ||
| "Programming Language :: Python :: 3", | ||
| "Operating System :: MacOS", |
There was a problem hiding this comment.
The classifier "Operating System :: MacOS" is incomplete. The correct PyPI classifier should be "Operating System :: MacOS :: MacOS X" according to the PyPI classifier list.
| "Operating System :: MacOS", | |
| "Operating System :: MacOS :: MacOS X", |
| # Name of the exposed module/CLI (sets the wheel name and console script). | ||
| module-name = "dapper" | ||
|
|
||
| ## No [project.scripts] needed; maturin will generate the console entrypoint in bin mode No newline at end of file |
There was a problem hiding this comment.
[nitpick] The comment uses double hashes (##) which is inconsistent with the single hash (#) used for other comments in this file (lines 32, 34, 36). Consider using a single # for consistency.
| ## No [project.scripts] needed; maturin will generate the console entrypoint in bin mode | |
| # No [project.scripts] needed; maturin will generate the console entrypoint in bin mode |
Adds a pyproject.toml file to configure the build system for creating a Python wheel that includes the compiled Rust binary. This enables distribution and installation of the Rust functionality via pip without requiring users to install a rust compiler.