Add developer mode to bifrost

Installs all source packages with --editable flag, so that they can be
edited in-place.

Change-Id: Iba0be299aeb3ffe75e644c88d3df9c2af4ec9ef1
This commit is contained in:
Dmitry Tantsur 2020-07-31 19:20:43 +02:00
parent 635dac0c0f
commit 1dc4564b52
4 changed files with 14 additions and 1 deletions

View File

@ -163,6 +163,7 @@ def cmd_install(args):
testing=args.testenv,
use_cirros=args.testenv,
use_tinyipa=args.testenv,
developer_mode=args.develop,
extra_vars=args.extra_vars,
**kwargs)
log("Ironic is installed and running, try it yourself:\n",
@ -207,6 +208,8 @@ def parse_args():
install.set_defaults(func=cmd_install)
install.add_argument('--testenv', action='store_true',
help='running in a virtual environment')
install.add_argument('--develop', action='store_true', default=False,
help='install packages in development mode')
install.add_argument('--dhcp-pool', metavar='START-END',
help='DHCP pool to use')
install.add_argument('--release',

View File

@ -10,6 +10,7 @@ source_install: false
ansible_python_interpreter: "{{ bifrost_venv_dir + '/bin/python3' if enable_venv | bool else '/usr/bin/python3' }}"
# Pip options
developer_mode: false
extra_args:
pip_install_retries: 5
pip_install_delay: 10

View File

@ -71,7 +71,10 @@
# NOTE(dtantsur): do not use constraints here, it does not work when the
# package itself is constrained.
- name: "Install from {{ sourcedir }} using pip"
command: pip3 install {{ sourcedir }} {{ extra_args | default('') }}
pip:
name: "{{ sourcedir }}"
editable: "{{ developer_mode | bool }}"
extra_args: "{{ extra_args | default('') }}"
when: source_install | bool
environment: "{{ bifrost_venv_env if (enable_venv | bool) else {} }}"

View File

@ -0,0 +1,6 @@
---
features:
- |
Set the new parameter ``developer_mode`` to ``true`` to make all packages
installed from source to be installed with the ``--editable`` flag.
The corresponding ``bifrost-cli`` argument is ``--develop``.