我如何制作一个python套餐,并在conda-forge(甚至在我的个人康达频道)上使用诗歌开发?
我使用 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 包。
请帮助我了解我所缺少的内容,以及是否有一种更简单的方法可以使我的诗歌项目作为 conda 包在 conda-forge 上甚至在我的个人 anaconda 频道上提供。
I have developed my first Python package using Poetry as a dependency management and packaging tool.
Publishing my work to PyPI has been as easy as running:
poetry publish --build
Now, I'd like to make my package available in the conda ecosystem too. As a preliminary step, I've tried to build it locally with conda build
.
This is what my (anonymized) meta.yaml
file looks like:
{% 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>"
Upon running conda build
, the following exception is raised:
ModuleNotFoundError: No module named 'poetry'
immediately after these lines:
[...]
Processing $SRC_DIR
Preparing wheel metadata: started
Preparing wheel metadata: finished with status 'done'
This is my very first time creating a conda package.
Please, help me understand what I'm missing and if there is an easier way to make my Poetry project available as a conda package on conda-forge or even on my personal anaconda channel.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您似乎缺少“构建要求”部分。
You seem to be missing the build requirements section.
以下内容对我有用:
请确保:
{{PYTHON}}
而不是 pythonbuild
和host 中包含
poetry
要求The following worked for me:
Make sure you:
{{PYTHON}}
instead of pythonpoetry
in bothbuild
andhost
requirements