Search code examples
pythonsetuptoolssetup.py

Setup.py: How to add external installation candidates?


I want to configure my setup.py file for a proper installation. Packages and programs which are available through PYPI are no problem thanks to the parameter install_requires. Additionally I need to deploy external packages like xvfb.

Can you recommend me a way how to add external dependencies / packages / programs to my setup.py installation?

My current setup.py file

from setuptools import setup, find_packages

setup(
    name = 'package_name',
    version = '0.3.1',
    packages = find_packages('src'),
    package_dir={'':'src'},
    install_requires=['selenium', 'nose',])

EDIT: The goal is to create an installation skript which installs the required packages and the external candidates like this:

>>> sudo python setup.py install 
# installs selenium, nose and for instance xvfb through e.g. apt-get.

Solution

  • In general, setup.py does not allow any other dependencies, except python's (PYPI). You can try build deb packages for your module.

    Check this tutorial: https://wiki.debian.org/Python/Packaging