创建从git存储库安装的Python .egg(Create Python .egg that installs from git repository)

编程入门 行业动态 更新时间:2024-10-27 05:29:13
创建从git存储库安装的Python .egg(Create Python .egg that installs from git repository)

我目前正在研究Python产品的部署技术。 我们已经使用多个git存储库管理代码,但希望改进设置和更新服务器的过程。 似乎easy_install,.egg文件和virtualenv是当今最好的工具。

这是一个问题:我们并没有真正进行版本控制; 我们所有的产品都有一个主分支,它应该始终提供稳定的代码。 如果我们想要更新,我们必须在每个服务器上为每个产品及其所有依赖项提供主分支。

这个解决方案非常耗时,我们希望改进它。

我的想法是在所有服务器/安装上创建virtualenv实例,并使用easy_install来安装和更新我们自己的包,但是我找不到一种方法来指定git存储库作为源代码的源。

有没有办法实现这一目标? 我错过了什么? 我是否朝错误的方向前进,这总体上是一个坏主意?

在此先感谢Fabian

I'm currently researching deployment techniques for our Python products. We manage our code with multiple git repositories already but want to improve the process of setting up and updating our servers. It seems that easy_install, .egg files and virtualenv are the best tools for doing this nowadays.

Here's the catch: We don't really do versioning; all our products have a master branch which is supposed to provide stable code all the time. If we want to update, we have to git pull the master branch on every server, for each product and all its dependencies.

This solution is very time-consuming and we want to improve it.

My idea was to create a virtualenv instance on all servers/installations and use easy_install to install and update our own packages, but I couldn't find a way to specify a git repository as a source for the source code.

Is there a way to achieve that? Did I miss something? Am I going in the wrong direction and this is a bad idea overall?

Thanks in advance, Fabian

最满意答案

您可以使用pip而不是easy_install,它支持许多可能的方法来指定从哪里获取包,一个是git ,然后您可以像这样安装包:

请点击安装git://my.git-repo.com/my_project.git

You can use pip instead of easy_install, it supports a number of possible ways to specify where to get the package from, one being git, you could then install your package like this:

pip install git://my.git-repo.com/my_project.git

更多推荐

本文发布于:2023-07-24 00:17:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239165.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:egg   Python   git   repository   installs

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!