【问题标题】:When building conda packages using conda-build and my code uses pure python libraries, what do I need to put in build/host/run in the meta.yaml file?当使用 conda-build 构建 conda 包并且我的代码使用纯 python 库时,我需要在 meta.yaml 文件中的 build/host/run 中放入什么?
【发布时间】:2021-04-07 07:34:29
【问题描述】:

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


    【解决方案1】:

    你可以只指定你的包的 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
    

    【讨论】:

      猜你喜欢
      • 2020-12-27
      • 2023-03-29
      • 1970-01-01
      • 1970-01-01
      • 2020-03-29
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多