diff --git a/bifrost/cli.py b/bifrost/cli.py index f43a9b111..214571baa 100644 --- a/bifrost/cli.py +++ b/bifrost/cli.py @@ -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', diff --git a/playbooks/roles/bifrost-pip-install/defaults/main.yml b/playbooks/roles/bifrost-pip-install/defaults/main.yml index bade9401d..019db9e14 100644 --- a/playbooks/roles/bifrost-pip-install/defaults/main.yml +++ b/playbooks/roles/bifrost-pip-install/defaults/main.yml @@ -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 diff --git a/playbooks/roles/bifrost-pip-install/tasks/main.yml b/playbooks/roles/bifrost-pip-install/tasks/main.yml index b75b0cf2c..5a13bbf84 100644 --- a/playbooks/roles/bifrost-pip-install/tasks/main.yml +++ b/playbooks/roles/bifrost-pip-install/tasks/main.yml @@ -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 {} }}" diff --git a/releasenotes/notes/developer-mode-000e7a125642b9e1.yaml b/releasenotes/notes/developer-mode-000e7a125642b9e1.yaml new file mode 100644 index 000000000..cd6d9ebbf --- /dev/null +++ b/releasenotes/notes/developer-mode-000e7a125642b9e1.yaml @@ -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``.