Linking against python for tests that depend on a pyo3_extension

未关闭
#3,889 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
文档
描述清晰度
基本清楚
活跃度
停滞
技术栈
python, rust

调研方向

从 pyo3_extension 文档和 rules_rust 对 rust_test 目标的处理开始,然后将其与 Cargo 的 extension-module 功能行为进行比较。检查 rules_python 工具链如何提供 Python 库,并编写文档,说明测试如何链接 libpython,而不改变 extension-module 构建。

由索引模型根据 Issue 内容生成。

描述

awaiting-response pyo3

We have a pyo3_extension target which builds a python extension module. As I understand it, this builds as if the extension-module feature is enabled so that the library does not link against python. But in some tests we would like to link against libpython so that tests can use pyo3 features such as PyResult. Is there any documentation about how to do this with rules_rust? In cargo we can disable the extension-module feature when running tests and everything works as expected. Is there a dependency I can get from a rules_python toolchain for example to link libpython into a particular rust_test target?

主要语言
Starlark
星标
857
派生
701
平均合并
4 天 7 小时
30 天内合并 PR
46

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bazelbuild/rules_rust 的其他 Issue

查看 bazelbuild/rules_rust 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。