From a4c3ff0597fefb9d49a9111e8f0bbff7fcb0531e Mon Sep 17 00:00:00 2001 From: Chandan Singh Date: Fri, 15 Nov 2019 15:02:06 +0000 Subject: setup.py: Add plugin requirements as extras Currently, there isn't an easy way to install BuildStream along with its plugin dependencies, using pip. Add plugin requirements as extras (https://setuptools.readthedocs.io/en/latest/setuptools.html#declaring-extras-optional-features-with-their-own-dependencies) so that they can be installed by specifying the relevant extras to `pip`. This repository has only one plugin - `deb` source - that has external dependencies, i.e. `arpy`. With this patch, one should be able to install BuildStream and dependencies for the `deb` plugin using something like `pip instal BuildStream[deb]`. --- setup.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/setup.py b/setup.py index 19779fb69..c6dc2eec7 100755 --- a/setup.py +++ b/setup.py @@ -301,6 +301,14 @@ with open('requirements/dev-requirements.in') as dev_reqs: with open('requirements/requirements.in') as install_reqs: install_requires = install_reqs.read().splitlines() +# Dependencies of plugins. These are not strict requirements for installing +# BuildStream so add them as extras. +# +# This is a mapping between the plugin name and its dependencies. +extras_require = { + "deb": ["arpy"], +} + ##################################################### # Prepare package description from README # ##################################################### @@ -469,6 +477,7 @@ setup(name='BuildStream', install_requires=install_requires, entry_points=bst_install_entry_points, tests_require=dev_requires, + extras_require=extras_require, ext_modules=cythonize( BUILD_EXTENSIONS, compiler_directives={ -- cgit v1.2.1