[英]How can I make a Python package developed with Poetry available on conda-forge (or even on my personal conda channel)?
我使用 Poetry 作為依賴管理和打包工具開發了我的第一個 Python 包。
將我的工作發布到 PyPI 就像運行一樣簡單:
poetry publish --build
現在,我也想讓我的包在 conda 生態系統中可用。 作為初步步驟,我嘗試使用conda build
在本地構建它。
這是我的(匿名的) meta.yaml
文件的樣子:
{% set version = "0.1.4" %}
package:
name: "<my-package-name>"
version: {{ version }}
source:
url: <URL-of-the-source-distribution-of-my-package-on-PyPI>.tar.gz
sha256: <SHA256-of-the-source-distribution-of-my-package-on-PyPI>
build:
noarch: python
script: python -m pip install .
requirements:
host:
- python
- pip
run:
- python
about:
license: MIT
license_familY: MIT
license_file: LICENSE
summary: "<Brief-project-description>"
運行conda build
時,會引發以下異常:
ModuleNotFoundError: No module named 'poetry'
在這些行之后:
[...]
Processing $SRC_DIR
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
這是我第一次創建 conda 包。
請幫助我了解我所缺少的內容,以及是否有更簡單的方法可以讓我的 Poetry 項目在 conda-forge 甚至我的個人 anaconda 頻道上以 conda 包的形式提供。
您似乎缺少構建要求部分。
requirements:
build:
- python
- pip
- poetry
以下對我有用:
package:
name: custom-package
version: "0.1"
source:
path: ./
build:
noarch: python
script: {{PYTHON}} -m pip install .
requirements:
build:
- python
- pip
- poetry
host:
- python
- poetry
run:
- python
- poetry
確保你:
{{PYTHON}}
而不是 pythonbuild
和host
要求中包含poetry
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.