pypackage

Create RPMs or DEBs from a requirement file.

Example

Create a pip requirements file:

$ cat pyvcf.txt
cython
pysam
pyvcf

Run pypackage on it:

$ pypackage.py pyvcf.txt
...
Created deb package {"path":"/home/james/Src/scratch/pyvcf_1.0_i386.deb"}

Install package and use:

$ sudo dpkg -i pyvcf_1.0_i386.deb
(Reading database ... 340558 files and directories currently installed.)
Preparing to replace pyvcf 1.0 (using pyvcf_1.0_i386.deb) ...
Unpacking replacement pyvcf ...
Setting up pyvcf (1.0) ...

$ vcf_filter.py
usage: vcf_filter.py [-h] [--no-short-circuit] [--no-filtered]

What it does

This script creates a virtual environment, uses pip to install your requirements, fixes up the environment to use the correct paths, creates links from /usr/local/bin to any scripts and then uses fpm to build a DEB/RPM.

Why?

Because you want to ship an entire virtual environment and not rely on system packages for python or python libraries.

Installing

For the moment, you need to install fpm (gem install fpm) and ensure it is on your PATH. Then clone this repository and run pypackage.py.



pypackage

从需求文件创建RPM或DEB。

示例

创建pip需求文件:

$ cat pyvcf.txt
cython
pysam
pyvcf

运行包装:

$ pypackage.py pyvcf.txt
…
Created deb package {"path":"/home/james/Src/scratch/pyvcf_1.0_i386.deb"}

安装包并使用:

$ sudo dpkg -i pyvcf_1.0_i386.deb
(Reading database … 340558 files and directories currently installed.)
Preparing to replace pyvcf 1.0 (using pyvcf_1.0_i386.deb) …
Unpacking replacement pyvcf …
Setting up pyvcf (1.0) …

$ vcf_filter.py usage: vcf_filter.py [-h] [–no-short-circuit] [–no-filtered]

它是什么

此脚本创建一个虚拟环境,使用pip来安装您的需求, 修复环境以使用正确的路径,从/ usr / local / bin创建链接 任何脚本,然后使用fpm构建DEB / RPM。

为什么?

因为您想要运送整个虚拟环境而不依赖于系统 python或python库的包。

安装

目前,您需要安装fpm( gem install fpm ),并确保它是 在你的路上然后克隆此存储库并运行 pypackage.py




相关问题推荐