From 63f95b4553354a2d0f861b8385a7f6b4af2c66cb Mon Sep 17 00:00:00 2001 From: Scott K Logan Date: Wed, 13 Sep 2023 14:31:21 -0500 Subject: [PATCH] Remove setup.py link after successful _undo_develop (#578) This function reverts a previous setuptools 'develop' operation, but doesn't actually clean up the artifacts under the build tree that it used to determine that 'develop' was previously used. The result is that after performing a build with --symlink-install, all subsequent builds of that package without --symlink-install will run the commands to "undo" the develop operation even if there is nothing to undo. This should provide a small performance improvement under those specific circumstances. --- colcon_core/task/python/build.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/colcon_core/task/python/build.py b/colcon_core/task/python/build.py index b1b12b07..65d0e907 100644 --- a/colcon_core/task/python/build.py +++ b/colcon_core/task/python/build.py @@ -202,6 +202,8 @@ async def _undo_develop(self, pkg, args, env): ] completed = await run( self.context, cmd, cwd=args.build_base, env=env) + if not completed.returncode: + os.remove(setup_py_build_space) return completed.returncode def _undo_install(self, pkg, args, setup_py_data, python_lib):