From 7b795e8dd13afc4de29a6787e269814a9e14e6fd Mon Sep 17 00:00:00 2001 From: Jonathan Chapple Date: Mon, 11 Jul 2022 13:14:41 -0700 Subject: [PATCH] * Add --force-reinstall flag to pip3 install pip will skip the installation if the installed package version is the same as the current. However, during development, coders will likely rebuild multiple times without changing the package version. --force-reinstall achieves this. --- colcon_poetry_ros/task/poetry/build.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/colcon_poetry_ros/task/poetry/build.py b/colcon_poetry_ros/task/poetry/build.py index a70c686..37fe9b3 100644 --- a/colcon_poetry_ros/task/poetry/build.py +++ b/colcon_poetry_ros/task/poetry/build.py @@ -89,6 +89,10 @@ async def build(self, *, additional_hooks=None): "pip3", "install", wheel_name, + # pip will skip installation if the package version is the same + # but we want the installed version to always reflect the source + # regardless of the package version + "--force-reinstall", # Turns off Pip's check to ensure installed binaries are in the # PATH. ROS workspaces take care of setting the PATH, but Pip # doesn't know that.