Re: numpy-rust and ndarray crate is required for packaging tokenizers.
On 5/11/25 8:52 AM, 千代航平 wrote:
For the first step, I'm trying to package tokenizers that require some
Rust crates.
I could find that some crates are already in the Debian package, but I
couldn't find the numpy and ndarray crates.
Hello!
I briefly looked into this, the `numpy` crate either needs backporting
to pyo3 0.22 (currently in Debian unstable), or you could attempt to
upgrade pyo3 to 0.24 (after the current Debian release is done in a few
months).
The `ndarray` crate is easier because all dependencies are already in
Debian. The tool I've used to detect this is `cargo-debstatus` (can be
installed with apt).
The process for "getting ndarray into Debian" is:
- sudo apt update && sudo apt install cargo rustc dh-cargo debcargo git
devscripts quilt
- git clone git@salsa.debian.org:rust-team/debcargo-conf.git
- cd debcargo-conf/
- run `./update.sh ndarray`
- edit src/ndarray/debian, especially the copyright file (there's a
auto-generated copyright file you can use as a base, but this file is
also meant to be commited unmodified so it's easier to notice future
changes)
- commit your changes into a branch (this is going to become your merge
request later)
- run `./release.sh ndarray` (this creates a new branch/commit that
we're going to discard later, it's only for testing)
- cd build/; ./build.sh ndarray
this takes some time, if there are lintian warnings, try fixing them by
amending the commit you're going to merge request (delete the
pending-ndarray branch before running ./release.sh again).
Getting used to this may take some time, there's also the #debian-rust
irc channel on oftc that I recommend joining. :) There you can get help
if you get stuck in any way.
I hope this helps,
kpcyrd
Reply to: