Skip to main content

Rust acceleration helpers for MoviePilot

Project description

MoviePilot-Rust

MoviePilot Rust 加速模块。

  • PyPI 包名:moviepilot-rust
  • Python 导入名:moviepilot_rust
  • 支持版本:Python 3.11+
  • 构建工具:PyO3 + maturin

项目结构

src/
├── bindings/   # Python API、输入快照和输出对象转换
├── filter/     # 类型化过滤规则、表达式 AST 和执行引擎
├── indexer/    # Indexer 配置模型、HTML 选择器和字段解析
├── metainfo/   # 元信息模型、配置、正则规则和影视标题解析
├── rss/        # RSS/Atom 数据模型和流式解析器
└── support/    # 与业务无关的有界缓存等基础设施

业务模块只接收和返回纯 Rust 类型,不直接持有 Python 对象。bindings 负责 PyO3 边界转换,因此核心解析器可以独立单测,并可在转换完成后释放 Python GIL。

本地开发安装

在本仓库根目录创建 .venv,并把 Rust 扩展直接安装到这个虚拟环境:

python3 -m venv .venv
.venv/bin/python -m pip install "maturin>=1.9,<2"
.venv/bin/python -m maturin develop --release

验证扩展是否可导入:

.venv/bin/python -c "import moviepilot_rust; print(moviepilot_rust.is_available())"

输出 True 表示本地编译安装成功。

本地检查

优先使用项目目录下的 .venv,一次编译后运行 Rust 和 Python 两层测试:

cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
.venv/bin/python -m maturin develop
cargo test --lib
.venv/bin/python -m pytest -q

本地打包

使用仓库内脚本构建当前平台 wheel 和源码包:

scripts/build_wheels.sh

产物会输出到 dist/,例如:

dist/moviepilot_rust-x.x.x-cp311-abi3-macosx_11_0_arm64.whl
dist/moviepilot_rust-x.x.x.tar.gz

脚本默认使用本仓库 .venv/bin/python

在 MoviePilot 主项目中使用

主项目通过普通 pip 依赖使用本模块,不再从主项目源码内编译 Rust。

以下命令在 MoviePilot 主项目根目录执行。

安装 PyPI 版本:

.venv/bin/pip install moviepilot-rust

安装本地刚构建的 wheel:

.venv/bin/pip install --force-reinstall ../MoviePilot-Rust/dist/moviepilot_rust-*.whl

在 MoviePilot 主项目里验证运行时状态:

.venv/bin/python -c "from app.utils import rust_accel; print(rust_accel.status())"

available=True 表示扩展已安装可用,enabled=True 表示 MoviePilot 当前配置开关允许使用 Rust 加速。

发布

在 GitHub 上 Publish Release 会触发 Actions,自动构建 Linux(glibc/musl)、macOS、Windows wheel 并发布到 PyPI;发布成功后还会向 MoviePilotv2 分支提交 bump requirements.in 的 PR(需配置 MOVIEPILOT_REPO_TOKEN)。

git tag vx.x.x
git push origin vx.x.x

然后在 GitHub 仓库 Releases → Draft a new release 中选择上述 tag 并点击 Publish release。仅推送 tag 不会触发构建。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

moviepilot_rust-0.2.1-cp311-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.11+Windows x86-64

moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_x86_64.whl (2.8 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.1+ x86-64

moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_aarch64.whl (2.6 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.1+ ARM64

moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

moviepilot_rust-0.2.1-cp311-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

moviepilot_rust-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl (2.4 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file moviepilot_rust-0.2.1-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5ae19d867d6d8eeb4a8a1da2c416295be6c6e18e2e80d892f915a4e6ea41d1c0
MD5 5e67187db42ec561144e10d7c85566ba
BLAKE2b-256 7f4837a79b7f4273e857da6a4c04acbbead86b128404f68c6efc670577d9ca2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.1-cp311-abi3-win_amd64.whl:

Publisher: release.yml on jxxghp/MoviePilot-Rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 43c8520fde245398f77f6f68c9f9050a4d87357e0d528410df7e4bd9c7ce4413
MD5 8c2879fbbf2987d8010a801036916fc7
BLAKE2b-256 b46e3484b1e307ee379454ff758148a813a451b5e375b3924b627aa7eb11f9d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_x86_64.whl:

Publisher: release.yml on jxxghp/MoviePilot-Rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 0ed047a8f7b51da5a6ff89d317b588850217d9ee9971d299297641b863341d1c
MD5 29cc951c2bc76f72f76362b5b17b6532
BLAKE2b-256 0f005b9f7074e6f3b27b7f271a1c5fdee96affdcda34d99ccd8d8336be64ede5

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.1-cp311-abi3-musllinux_1_1_aarch64.whl:

Publisher: release.yml on jxxghp/MoviePilot-Rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 37e9209ad2d6b1a495b483c541284d3b386aef49a697277c6edd44e222828950
MD5 861c4309970ed8793d800b3e706a0cd1
BLAKE2b-256 c31dbce13f50ff256e071934a5f0a2ebeef2cc7afa03335e96d030d0fa04dfd3

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on jxxghp/MoviePilot-Rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 611e555a62271b08f9098d50c62123a1935424e7b4acfee58f06a5b54d8e691a
MD5 6ab546e0ac41ff03cb591ce8c40a0643
BLAKE2b-256 987f8daf1059f90654c13cc3a828c1af51a2c39b1e723b7ef2c96526b5174fd8

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on jxxghp/MoviePilot-Rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moviepilot_rust-0.2.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 02f06227f22191437c73463924df1125e07d7eb43a3bc25028865abacd59eb62
MD5 8d849035ed178cdec3581f967a3eb774
BLAKE2b-256 7bc25e21bc97df719bdb3eddf7591cb0da0b33daee4380afcf80d1b73b3b42cd

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.1-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on jxxghp/MoviePilot-Rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file moviepilot_rust-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 8db1405cda1886a9338682c205fdac73f5175860259c8711d40832ceb4833727
MD5 9db236dff2646986396943a8af885393
BLAKE2b-256 db355a61019105c56d6bf117ebe06e2c219669bb4074f582790a36af237367d1

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.1-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on jxxghp/MoviePilot-Rust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page