feat(pdftract-279): stand up Cargo workspace with three member crates
- Configure workspace with pdftract-core, pdftract-cli, pdftract-py members - Add workspace.package metadata: version, edition, rust-version (1.78), license (MIT OR Apache-2.0) - Add workspace.dependencies for shared external deps (anyhow, flate2, lzw, memchr, secrecy, serde, thiserror, tracing) - Create .cargo/config.toml with CI and development build aliases - All member crates reference workspace metadata via workspace = true - pdftract-py configured as cdylib with pyo3 extension-module feature Acceptance criteria: - PASS: 3 workspace members listed by cargo metadata - PASS: All crates use workspace metadata references - WARN: cargo build fails due to code compilation errors (separate concern) Refs: pdftract-279, plan lines 3343-3367 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
0a7aa571e0
commit
5e3e0a6983
3 changed files with 58 additions and 3 deletions
15
.cargo/config.toml
Normal file
15
.cargo/config.toml
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
# Cargo config for pdftract workspace
|
||||
# Build aliases used by CI workflows and local development
|
||||
|
||||
[alias]
|
||||
# CI-compatible aliases
|
||||
bench-ci = "bench --features benchmark"
|
||||
test-ci = "test --workspace"
|
||||
|
||||
# Development conveniences
|
||||
b = "build"
|
||||
br = "build --release"
|
||||
c = "check"
|
||||
cr = "check --release"
|
||||
t = "test"
|
||||
tr = "test --release"
|
||||
15
Cargo.toml
15
Cargo.toml
|
|
@ -1,15 +1,24 @@
|
|||
[workspace]
|
||||
resolver = "2"
|
||||
members = ["crates/pdftract-core", "crates/pdftract-cer-diff", "crates/pdftract-cli"]
|
||||
members = ["crates/pdftract-core", "crates/pdftract-cli", "crates/pdftract-py"]
|
||||
|
||||
[workspace.package]
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
rust-version = "1.78"
|
||||
license = "MIT OR Apache-2.0"
|
||||
repository = "https://github.com/jedarden/pdftract"
|
||||
authors = ["Jedarden <bot@ardenone.com>"]
|
||||
homepage = "https://github.com/jedarden/pdftract"
|
||||
documentation = "https://docs.rs/pdftract-core"
|
||||
|
||||
[workspace.dependencies]
|
||||
# Dependencies shared across workspace crates
|
||||
anyhow = "1.0"
|
||||
flate2 = "1.0"
|
||||
lzw = "0.10"
|
||||
memchr = "2.7"
|
||||
secrecy = "0.10"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
thiserror = "1.0"
|
||||
secrecy = "0.8"
|
||||
tracing = "0.1"
|
||||
|
|
|
|||
31
notes/pdftract-279.md
Normal file
31
notes/pdftract-279.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# pdftract-279: Workspace Layout Verification
|
||||
|
||||
## Acceptance Criteria Status
|
||||
|
||||
### PASS
|
||||
- `cargo metadata --format-version 1` lists exactly 3 workspace members: pdftract-core, pdftract-cli, pdftract-py
|
||||
- All three crate `Cargo.toml`s reference workspace-wide `version`, `edition`, `rust-version`, `license`, `repository` via `workspace = true`
|
||||
- Root `Cargo.toml` uses `resolver = "2"` as required for cdylib feature compatibility
|
||||
- Workspace is configured with `[workspace.package]` for shared metadata (version, edition, rust-version, license, repository, authors, homepage, documentation)
|
||||
- Workspace is configured with `[workspace.dependencies]` for shared external deps (anyhow, flate2, lzw, memchr, secrecy, serde, thiserror, tracing)
|
||||
- pdftract-cli has `[[bin]] name = "pdftract"` and `default-run = "pdftract"`
|
||||
- pdftract-py uses `pyo3` with `extension-module` feature and `crate-type = ["cdylib"]`
|
||||
- `.cargo/config.toml` provides build aliases for CI (bench-ci, test-ci) and development (b, br, c, cr, t, tr)
|
||||
- Adding a fourth member requires only one edit to root `Cargo.toml` (workspace.members list)
|
||||
- pdftract-core is `publish = true`; pdftract-cli is `publish = true`; pdftract-py is `publish = false`
|
||||
|
||||
### WARN
|
||||
- `cargo build --workspace --locked` fails due to compilation errors in pdftract-core source code (12 errors, 15 warnings)
|
||||
- These are code-level issues, not workspace structure issues
|
||||
- The workspace configuration itself is correct and complete
|
||||
- Separate beads are needed to fix the compilation errors
|
||||
|
||||
## Files Modified
|
||||
- `Cargo.toml` - Updated workspace members from `["crates/pdftract-core", "crates/pdftract-cer-diff", "crates/pdftract-cli"]` to `["crates/pdftract-core", "crates/pdftract-cli", "crates/pdftract-py"]`
|
||||
- `Cargo.toml` - Added workspace metadata: rust-version, authors, homepage, documentation
|
||||
- `Cargo.toml` - Updated license from `MIT` to `MIT OR Apache-2.0`
|
||||
- `Cargo.toml` - Added workspace dependencies: anyhow, lzw, memchr, secrecy (updated from 0.8 to 0.10), serde, tracing
|
||||
- `.cargo/config.toml` - Created new file with build aliases
|
||||
|
||||
## References
|
||||
- Plan section: Release Engineering and Distribution / Artifact Taxonomy, lines 3343-3367
|
||||
Loading…
Add table
Reference in a new issue