我正在使用 conda-build 从 python 源代码构建 conda 包,每当我向 meta.yaml 中“requirements”部分的“run”或“host”子部分添加内容时,都会出现以下错误:
Tests failed for my_package-0.1.0-0.tar.bz2 - moving package to /home/ec2-user/anaconda3/conda-bld/broken
删除“运行”和“主机”子部分使测试运行正常 - 构建的 tar.bz2 文件安装没有问题,导入成功。添加“构建”小节可以正常工作。使用 --debug 标志运行并没有添加任何有用的信息。我该如何调试这个?
这是我的 meta.yaml:
package:
name: my_package
version: 0.1.0
source:
path: ..
build:
script: "python setup.py install --single-version-externally-managed --record=record.txt --verbose"
requirements:
# removing this subsection makes everything work
run:
- python
这是我的 run_test.sh (使用 run_test.py 代替产生相同的结果):
echo 'test is running' > /tmp/test_ran.txt
python -c "import my_package; print('Success!')" >> /tmp/test_ran.txt
这是我的 setup.py:
from setuptools import find_packages, setup
setup(
name='my_package',
version='0.1.0',
packages=find_packages()
)
meta.yaml 和 run_test.sh 脚本位于conda.recipe
项目根目录下的子文件夹中。
由于某种原因,测试脚本甚至没有运行(文件 /tmp/test_ran.txt 没有创建)!如上所述,删除“运行”小节使测试运行正常,包括导入。
提前致谢。有人可以帮忙吗?为这事发疯...