Skip to content

Commit

Permalink
Some docs for virtualenv support
Browse files Browse the repository at this point in the history
  • Loading branch information
nicobrevin committed Dec 30, 2016
1 parent 00adf41 commit 55f9355
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions docs/source/virtualenv.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
`virtualenv` - Python virtual environments
==========================================

Synopsis::

fpm -s virtualenv [other options] EGG_SPEC|requirements.txt

FPM has support for building packages that provide a python virtualenv from a
single egg or from a `requirements.txt` file. This lets you bundle up a set of
python dependencies separate from system python that you can then distribute.

.. note::
`virtualenv` support requires that you have `virtualenv` and the
`virtualenv-tools` binary on your path. This can usually be achieved with
`pip install virtualenv virtualenv-tools`.

Example uses:
=============

Build an rpm package for ansible::

fpm -s virtualenv -t deb ansible
yum install virtualenv-ansible*.rpm
which ansible # /usr/share/python/ansible/bin/ansible

Create a debian package for your project's python dependencies under `/opt`::

echo 'glade' >> requirements.txt
echo 'paramiko' >> requirements.txt
echo 'SQLAlchemy' >> requirements.txt
fpm -s virtualenv -t deb --name myapp-python-libs \
--virtualenv-install-location /opt/myapp \
requirements.txt

Create a debian package from a version 0.9 of an egg kept in your internal
pypi repository, along with it's external dependencies::

fpm -s virtualenv -t deb \
--virtualenv-pypi-extra-url=https://office-pypi.lan/ \
proprietary-magic=0.9

0 comments on commit 55f9355

Please sign in to comment.