如何将conda框架与未上传到pypi的软件包一起使用? [英] How can I use conda skeleton with packages that are not uploaded to pypi?

查看:86
本文介绍了如何将conda框架与未上传到pypi的软件包一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用conda框架为未上传到pypi的某些python软件包构建conda软件包。

I am trying to use conda skeleton to build conda packages for some python packages that were not uploaded to pypi.

我无法将其上传到pypi,但是我不不想不得不部署本地pypi服务器。它们存储在本地计算机上,这是最近一次构建的结果,现在我也要构建它们的conda软件包。

I cannot upload them to pypi and I don't want to have to deploy a local pypi server. They are stored on the local machine, being the results of a recent build and now I want to also build their conda packages.

我该怎么做?我尝试了-pypi-url 的各种选项,但出现了 OSError:不支持的XML-RPC协议该框架需要一个真正的PYPI,并且不能真正处理本地存储库。 PIP可以与本地目录一起使用而不会出现问题。

How can I do this? I tried various options for --pypi-url but I get a OSError: unsupported XML-RPC protocol which tells me that skeleton expects a real PYPI and that it cannot really deal with local repositories. PIP can work with local directories without problems.

有什么方法可以解决此问题?

What would be the way to overcome this?

推荐答案

您实际上不必使用conda框架。我相信您在conda env中构建了一个模块/软件包,并且希望将其打包。如果是这样,那么构建一个meta.yaml文件和一个build.sh(macOS)就足够了。

you do not actually have to use conda skeleton. I believe you have a module/package built within a conda env and you want to package it. if that is so then building a meta.yaml file and a build.sh (macOS) would be sufficient.

例如:
表示您有一个名为condabuild_sample的项目。

For example: say you have a project called condabuild_sample.

cd condabuild_sample

使用您喜欢的编辑器并创建一个新的文件meta.yaml我使用vim

vi meta.yaml

*更新meta.yaml:

*Update the meta.yaml:

package:
     name: <your package name>
     version: <ideally your git version>

source:
     git_path: <git link> 
requirements:
     run:
         - <a list of project import requirements>
about:
     home: <project home>
     license: <custom license file>*

实际上,只有标签:package是需要。您可以根据项目需要自定义所有内容。

Actually, only the tag: package is required. Rest all you can customize per your project needs.

然后创建另一个文件build.sh,并为您的软件包提供构建说明。 build.sh作为bash执行。但是您可以将其保留为空以学习和测试。

then create another file build.sh, and provide your build instructions for your package. build.sh is executed as a bash. But you can keep it empty to learn and test.

一旦拥有meta.yaml和bash.sh,请运行以下

Once you have your meta.yaml and bash.sh, run the following

conda构建condabuild_sample

如果没有错误,程序包将被添加到conda设置中的目录中。成功完成此步骤后,

If there are no mistakes, the package gets added to a directory within your conda set up. Once this step completes successfully,

conda install --use-local condabuild_sample

这将添加到本地可用的conda软件包列表中。
现在运行,以确认

This would add to the list of conda packages, that are available locally. Now run, to confirm,

conda列表

您还可以使用anaconda客户端将其上传到anaconda。

You can also upload to anaconda using an anaconda client.

我使用的参考链接:
Conda骨架示例

这篇关于如何将conda框架与未上传到pypi的软件包一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆