易于安装实时Python库/脚本 [英] Easy-install live python libraries/scripts

查看:141
本文介绍了易于安装实时Python库/脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有很多python脚本套件(正如我称之为的),我希望为我的同事进行简单的安装。我研究过,这似乎非常好,但在该方案(据我了解),我将不得不提交一个静态版本,并在每次更改时更新它们。

碰巧我会一路上在我的脚本套件中添加和更改很多内容,并且每当有人安装它时,我都希望它们获得最新版本。使用pip,这意味着在每次提交到我的存储库时,我都必须重新提交一个包到 PyPI索引。这是很多不必要的工作。



有没有办法提供一个简单的跨平台安装(通过pip或其他方式),它直接从我的github仓库中提取文件?

解决方案

我不确定我是否完全理解您的问题,但您可能想使用pip的可编辑安装[1]



下面是一个简单的例子:在这个假设的例子中,让我们假设你想使用git作为CVS。

  git clone url_to_myrepo.git path / to / local_repository 
pip install [--user] -e path / to / local_repository

包的安装将反映本地存储库的状态。因此,当远程存储库得到更新时,无需使用pip重新安装软件包。无论何时您将更改提交到本地存储库,安装都将保持最新。



[1] http://pip.readthedocs.org/zh-CN/latest/reference/pip_install.html#editable-installs


I have a number of python "script suites" (as I call them) which I would like to make easy-to-install for my colleagues. I have looked into pip, and that seems really nice, but in that regimen (as I understand it) I would have to submit a static version and update them on every change.

As it happens I am going to be adding and changing a lot of stuff in my script suites along the way, and whenever someone installs it, I would like them to get the newest version. With pip, that means that on every commit to my repository, I will also have to re-submit a package to the PyPI index. That's a lot of unnecessary work.

Is there any way to provide an easy cross-platform installation (via pip or otherwise) which pulls the files directly from my github repo?

解决方案

I'm not sure if I understand your problem entirely, but you might want to use pip's editable installs[1]

Here's a brief example: In this artificial example let's suppose you want to use git as CVS.

git clone url_to_myrepo.git path/to/local_repository
pip install [--user] -e path/to/local_repository

The installation of the package will reflect the state of your local repository. Therefore there is no need to reinstall the package with pip when the remote repository gets updated. Whenever you pull changes to your local repository, the installation will be up-to-date as well.

[1] http://pip.readthedocs.org/en/latest/reference/pip_install.html#editable-installs

这篇关于易于安装实时Python库/脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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