python - 当使用 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 依赖项。这是 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
推荐阅读
- python - 如果满足特定条件,如何使我的输出返回 True?
- javascript - 如何在 Swiper JS 中使用 activeIndex,如何使第二个滑块处于活动状态,而不是第一个
- docker - gitlab-runner:无法使用自定义容器连接到 unix:///var/run/docker.sock 的 Docker 守护进程
- excel - POI编辑excel表格时如何保持背景色
- sql - 关闭/打开与变量相关的条件
- ruby-on-rails - rails generate 失败缺少捆绑器
- django-rest-framework - Django Rest - 序列化与继承模型的关系
- sql - Laravel hasManyThrough 嵌套时出错
- c++ - 用另一个替换字符串中的一对字符
- sql - SQL Server 表中无数据时显示空值