【发布时间】:2023-01-11 02:14:29
【问题描述】:
我已经使用 Boost.Python 构建了一个自己的 dll(称之为 myLib.pyd)。 dll 链接到正确的 python lib 文件,例如 $PYTHONHOME/libs/python39.lib
我的目录结构看起来像
binaries/
myLib_py39.pyd
myLib_py310.pyd
conda-recipe/
build.bat
conda_build_config.yaml
meta.yaml
my-package/
__init__.py
myLib.pyd
其中 myLib.pyd 是的手动副本任何一个myLib_py39.pyd 或 myLib_py310.pyd。
meta.yaml 看起来像
package:
name: my-package
source:
path: ..
requirements:
build:
- python {{ python }}
- setuptools
run:
- python
和元.yaml
python:
- 3.9
- 3.10
当我运行conda build "conda-recipe"时,它正确地为 python-3.9 和 python-3.10 构建了包,但是我需要以某种方式确保在为每个单独的 python 版本构建之前将正确的 .pyd 文件从二进制目录复制到包中.
另一种选择是将两个 .pyd 文件都包含到 conda 包中,并确保我有一些 python 逻辑来导入正确的逻辑,但这似乎不像其他包那样做。
我试图制作一个循环遍历 python 版本的 powershell 脚本,但我的解决方案太老套了,我认为 conda 在某种程度上可以为我解决这个问题。注意 - 它工作正常并且符合预期,只要我手动复制正确的 .pyd 版本
【问题讨论】: