mirror of
https://github.com/jordansissel/fpm
synced 2025-08-30 04:10:42 +02:00
Original `virtualenv-tools` causes issues when building Python3 virtual environments. Previously reported in #1491.
41 lines
1.4 KiB
ReStructuredText
41 lines
1.4 KiB
ReStructuredText
`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.
|
|
- For python2 virtual environments, this can usually be achieved with `pip install virtualenv virtualenv-tools`.
|
|
- For python3 virtual environments, use `pip install virtualenv-tools3` instead.
|
|
|
|
Example uses:
|
|
-------------
|
|
|
|
Build an rpm package for ansible::
|
|
|
|
fpm -s virtualenv -t rpm 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 \
|
|
--prefix /opt/myapp/virtualenv 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
|