Add option for default pip package install

Add an option to define a default set of python packages to install
within a virtual environment. This can be used to install a package
wihin a virtual environment that may be outside of a normal package
list but for a given service.

Change-Id: Iace13b8b4156b0aa6a919cf2b1f3a0c4376a74ee
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-06-11 23:33:34 -05:00
parent 51fb5bb898
commit 7a4d888d35
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
3 changed files with 11 additions and 1 deletions

View File

@ -121,3 +121,7 @@ repo_pip_packages:
- wheel
repo_build_store_pip_sources: false
# Default python packages which will be installed
# into every venv.
repo_venv_default_pip_packages: []

View File

@ -0,0 +1,6 @@
---
features:
- The option ``repo_venv_default_pip_packages`` has been added which will
allow deployers to insert any packages into a service venv as needed.
The option expects a list of strings which are valid python package names as
found on PYPI.

View File

@ -146,4 +146,4 @@ VENV_CREATE_COMMAND="{{ repo_build_venv_command_options }}"
{# #}
{# Finally, we output the alphabetically sorted requirements. #}
{# #}
ROLE_VENV_REQUIREMENTS="{{ (requirement_list | sort) | join(' ') }}"
ROLE_VENV_REQUIREMENTS="{{ (repo_venv_default_pip_packages | union(requirement_list) | sort) | join(' ') }}"