pyclass warning on update pyo3

未關閉 適合新手
#53 0 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
68/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
python, rust
領域
api

研究方向

該警告指向 src/lib.rs 第 767 行,即 Python 綁定 crate(microbiorust-py)中的一個 #[pyclass] 屬性。執行 cargo build 或 cargo test 重現問題,然後檢查該 crate 中每個 #[pyclass] 是否有衍生 Clone 的型別。依照警告的建議加入 from_py_object 或 skip_from_py_object,並根據 Python 是否需要把該型別傳回 Rust 為每個型別分別選擇。當建置不再出現棄用警告且測試仍然通過時,即完成。

由索引模型根據 Issue 內容生成。

描述

Describe the bug
Updated pyo3 to 0.29.0 after receiving alert

warning: use of deprecated associated constant pyo3::impl_::deprecated::HasAutomaticFromPyObject::<true>::MSG: The FromPyObject implementation for #[pyclass] types which implement Clone is changing to an opt-in option. Use #[pyclass(from_py_object)] to opt-in to the FromPyObject derive now, or #[pyclass(skip_from_py_object)] to skip the FromPyObject implementation.
--> src/lib.rs:767:1
|
767 | #[pyclass]
| ^^^^^^^^^^
To Reproduce
Steps to reproduce the behavior:

git clone microBioRust
cd microbiorust-py
maturin develop --release 

or

cargo test

Expected behavior
tests are all passing in pytest and in cargo test but receiving deprecation warning

Desktop (please complete the following information):
Mac OSX

Additional context
Add any other context about the problem here.

主要語言
Rust
星號
38
分支
15
平均合併
21 小時 33 分鐘
30 天內合併 PR
2

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

LCrossman/microBioRust 的其他 Issue

查看 LCrossman/microBioRust 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。