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.0-cp311-abi3-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.11+Windows x86-64

moviepilot_rust-0.2.0-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.0-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.0-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.0-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.0-cp311-abi3-macosx_11_0_arm64.whl (2.3 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

moviepilot_rust-0.2.0-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.0-cp311-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 ce4caf465c8306340e7a5af8c243cb0a1845b85e1db26cc1d399842205abdbd6
MD5 29edb11723e8c3f5308311ae0db096c9
BLAKE2b-256 6b2510f1da2a6765b73615dbbf660f0abd8f265a9a4237fdf6b7f53d083afed9

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.0-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.0-cp311-abi3-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.0-cp311-abi3-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 e773816c7793cdf618ddcc09fc954f6a7f2d84d2fbd35723f8f329c38df679d0
MD5 987c792f6374b4e095152d18e42d272c
BLAKE2b-256 758ca1784abb87228978d71bccc52789ce5898d6e4a2cc26416af02892e54d9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.0-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.0-cp311-abi3-musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.0-cp311-abi3-musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 c4ffdfea943816d85a94b4f8c1ac7b0703669b2abf72e862e105e5b9a53adbdb
MD5 0f7a78b11c8c1b0c1c6cf2a800136814
BLAKE2b-256 8b7817b1e4673584b22fa61810d96c0aced3efeab584e1d64f4f264466c88891

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.0-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.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd9c206a23561ea328150223ca0f959ec57457170cab0f57ac372d6b2f699dfe
MD5 4464b718742322e39b4b33ef3f777006
BLAKE2b-256 0e03913343f884630b849763ff079252b0b72e7a1398c25850de300c4d82dac4

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.0-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.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 9c4fa0f6bae12c53c2cbcc36cc30a672f45a5dbc3cfea4d945d7b3a3a9652078
MD5 7d15d8a1dead726a0e3f540edcc4aa2a
BLAKE2b-256 16bbf03cd5f835a69deccea35973cfa2056ac0640feb204486fcc7aba05ce689

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.0-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.0-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7aab0339c21ad0ebe1d60b48e3146fc9b874b3c15518957f57801921f4fc5207
MD5 f0a89ce6c049e2fbe84611dd33c79f27
BLAKE2b-256 38b75929ac2ea2d36c64604af317e75e697500f2bf34bc73a8cc9615dec2517f

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.0-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.0-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for moviepilot_rust-0.2.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 30527089fe8cc69c18c87ca4e27c5d682df587779448c561cce069b986681e8a
MD5 19aecd132438b98ca5463a209c3ffeb1
BLAKE2b-256 0cd96065eecf23b6793fe57aaca32f20de6df99ba8c81e22b5929accc4c6f8ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for moviepilot_rust-0.2.0-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