Commit 13cfa70
refactor: inline dlpack-sys into dlpack-rs; single publishable crate 0.3.3 (#8)
* refactor: inline dlpack-sys into dlpack-rs; single crate, bump 0.3.3
Fold the `dlpack-sys` crate (bindgen bindings + vendored dlpack.h + build.rs)
into `dlpack-rs` as a private `sys` module. DLPack is header-only (the FFI is
pure structs/consts + fn-pointer types, no native linkage), so no `links`/
sys crate is needed.
Motivation: publishing `dlpack-rs` to crates.io required its `dlpack-sys`
path dep to be a published, versioned crate — but the `dlpack-sys` name is
owned by an unrelated crate. Inlining removes the dependency entirely, so
`dlpack-rs` (which we own on crates.io) publishes as a single self-contained
crate. `cargo publish --dry-run` passes.
- src/sys.rs: `include!("bindings.rs")` + ABI layout test (was dlpack-sys/lib.rs)
- src/ffi.rs: re-export `crate::sys::*` instead of the `dlpack_sys` crate
- build.rs + vendor/ + bindings.rs moved to crate root; `bindgen` opt-in feature
- [lib] doctest = false (bindgen C doc comments carry fenced blocks)
- delete dlpack-sys/; bump 0.3.2 -> 0.3.3. No public API change.
Builds default + pyo3; tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* ci: fix regenerate-check for single-crate layout; add guarded release workflow
- regenerate-check: cargo build --features bindgen (was -p dlpack-sys); diff
src/bindings.rs (was dlpack-sys/src/bindings.rs) after the inline.
- add release.yml: workflow_dispatch, guarded by typing 'publish', runs
cargo publish for dlpack-rs using the repo's CARGO_REGISTRY_TOKEN secret.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
* style: rustfmt — order mod declarations
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0f2e2a2 commit 13cfa70
12 files changed
Lines changed: 66 additions & 40 deletions
File tree
- .github/workflows
- dlpack-sys
- src
- vendor/dlpack
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | | - | |
| 89 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | 1 | | |
6 | 2 | | |
7 | 3 | | |
8 | 4 | | |
9 | | - | |
| 5 | + | |
10 | 6 | | |
11 | 7 | | |
12 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
18 | | - | |
19 | 23 | | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
File renamed without changes.
This file was deleted.
File renamed without changes.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
1 | 6 | | |
2 | 7 | | |
3 | 8 | | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| 12 | + | |
7 | 13 | | |
8 | 14 | | |
9 | 15 | | |
| |||
0 commit comments