Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

distribute-install_component

This package adds a command to distribute to interact with the extra components listed in extras_require.

For example, you could write a setup.py containing:

setup(
    name="Project-A",
    ...
    extras_require={
        'PDF': ["ReportLab>=1.2", "RXP"],
        'reST': ["docutils>=0.3"],
    }
 )

Then distribute-install_component allows you to write:

$ python setup.py install_component PDF reST

to install the dependencies needed for these features.

Commandline Arguments

install_component takes a list of components to install dependencies for. These must be listed in the extras_require section of the package.

The -l option can be used to list the components available.

Configuring a package

To make distribute-install_component available in your package, you can add it to setup_requires in your setup.py:

setup(
    name='myproject',
    ...
    setup_requires=[
        'distribute-install_component',
    ]
)

Tips

You can use distribute-install_requires to provide development dependencies, such as documentation builders or testing packages:

setup(
    name='myproject',
    ...
    setup_requires=[
        'distribute-install_component',
    ],
    extras_require={
        'test': ['nose==1.1.2', 'mock==0.8.0'],
        'docs': ['Sphinx>=1.1.3', 'sphinxcontrib-httpdomain==1.1.7'],
    }
)

Then normal users can just run

$ python setup.py install

While developers can run

$ python setup.py develop install_component test docs

Recent activity

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.