9 个不稳定版本 (3 个破坏性更新)
| 0.5.1 | 2024 年 5 月 13 日 |
|---|---|
| 0.5.0 | 2024 年 5 月 12 日 |
| 0.4.0 | 2024 年 3 月 3 日 |
| 0.3.11 | 2024 年 1 月 23 日 |
| 0.1.7 | 2023 年 9 月 29 日 |
#156 in FFI
每月 24 次下载
在 5 个 Crates 中使用 (通过 libpt)
40KB
434 行
pt / libpt
pt 代表 "个人工具"、"plex 工具"、"pete" 或类似的东西。这是一个我可能会或可能不会使用的工具集合。这个仓库的目的是将我认为值得拥有的任何个人程序编程到其中,然后将其作为库、crate、Python 模块或可执行文件使用。
看看我会不会把它弄成一个臃肿的垃圾,或者写 30 个 "hello world" 之后停止提交。
依赖
- 见
cargo.toml - Rust 的 openssl 绑定
- Python
maturin-pip install maturin
从源码编译和安装
如果您只想安装 Rust 库,您可以使用 cargo build 来构建它。像其他本地依赖项一样将其添加到您的项目中。
如果您还想使用 Python 变体,则需要使用 maturing 进行编译。
- 在
venv中安装:maturin develop --release - 在系统中安装:
maturin build --release && pip install target/wheels/libpt-x.x.x-*
从 pypi 安装
libpt 已打包在 pypi.org。
您可以使用 pip install libpt 来安装它
从 crates.io 安装
libpt 已打包上传至 crates.io。
您可以使用以下命令将库添加到您的项目中:cargo add libpt。
从我的个人包仓库安装
libpt 已打包上传至 git.cscherr.de。
您可以将此仓库添加到您的 config.toml 文件中,然后使用以下命令:cargo add libpt
测试
需要对 Rust 和 Python 部分分别进行测试
- 使用
cargo test进行 Rust 测试 - 使用
./scripts/pytests.sh或python -m unittest discover -fs tests/python进行 Python 测试
文档
可以使用 cargo doc --open 自动生成文档。
最新的文档版本可在此处找到 here
许可
Pt 采用 MIT 许可协议
依赖
~2.7–3.5MB
~65K SLoC