Distributing a python package along with module dependencies using RPM

穿精又带淫゛_ 提交于 2019-12-03 05:51:54

I'd see it as two separate problems.

  1. You want a repeatable install/build system for your developers.

  2. You want an installer builder.

Buildout (or pip, perhaps in combination with an extra script) can take care of the first problem. Basically: "how to get the project ready for development on a fresh laptop". Ideally you'd just say python bootstrap.py;bin/buildout and be ready (same with pip/virtualenv).

Now that you have a repeatable build, you can use that as the basis for an installer. Handiest is a clean virtual machine that you use just for this purpose. Virtualbox/vagrant, for instance. Make scripts that set up the virtualbox and that install the proper dependencies in there.

The installer builder script can then make a fresh checkout of your project inside the virtualbox and do the repeatable build thingy in the location where you want to have it in the installer (/opt/yourproject, for instance).

Then use FPM to make the actual package (.deb, .rpm, whatever). Pass in FPM options that tells it about the necessary dependencies, this way you can always be sure those dependencies are installed. (Note: these are OS-level dependencies like memcached or postgres; the python dependencies should be handled by pip or buildout).

If you split up your big problem in these two smaller problems, both can be attacked separately.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!