当使用 conda-build 构建 conda 包并且我的代码使用纯 python 库时,我需要在 meta.yaml 文件中的 build/host/run 中放入什么?

问题描述

假设我有一个使用 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

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...