问题描述
假设我有一个使用 pandas、numpy 和 matplotlib 的 python 包。如果我查看他们的 Meta.yaml 文件,我会在需求部分看到很多依赖项。例如。编译器如 make。我是否需要在我自己的 Meta.yaml 包中也从 build 和 host 部分命名所有这些依赖项,或者如果我只写就足够了:
Requirements:
Host:
- python 3.8
Build:
- python 3.8
Run:
- pandas
- numpy
- matplotlib
解决方法
你可以只指定你的包的 python 依赖项。 Here's an example from conda-forge.
这是一个虚构的例子:
package:
name: foobar
version: 0.1
source:
git_url: https://github.com/greenfish/foobar
git_tag: v0.1
build:
number: 0
noarch: python
script: {{ PYTHON }} -m pip install . --no-deps -vv
requirements:
host:
- python
- pip
run:
- python
- pandas >=1.0
- numpy
test:
imports:
- foobar
about:
home: http://greenfish-foobar.org
license: BSD-3-Clause
license_file: LICENSE.txt
summary: This package is for all your foobar needs