How to install optional python dependencies in setup.py

From razwiki
Jump to navigation Jump to search

For a setup.py that has a section:

extras_require = {
    # Test dependencies
    'tests': [
        'bandit>=1.5.0',
        'flake8>=3.2.1',
        'pytest>=6.1.0',
    ],
    'prospector': [
        'prospector[with_everything]>=0.12.4',
        'pytest>=6.1.0',
    ],
}

Do, for example:

pip install .[prospector]