| 123 | class build_py(_build_py): |
| 124 | |
| 125 | def run(self): |
| 126 | super().run() |
| 127 | |
| 128 | # Copy the repository root's `projects/` into the build directory's `ms_agent/projects/` |
| 129 | src = os.path.join(os.path.dirname(__file__), 'projects') |
| 130 | if os.path.isdir(src): |
| 131 | dst = os.path.join(self.build_lib, 'ms_agent', 'projects') |
| 132 | os.makedirs(os.path.dirname(dst), exist_ok=True) |
| 133 | |
| 134 | if os.path.exists(dst): |
| 135 | shutil.rmtree(dst) |
| 136 | |
| 137 | shutil.copytree(src, dst) |
| 138 | |
| 139 | # Build and copy webui |
| 140 | self._build_and_copy_webui() |
| 141 | |
| 142 | def _build_and_copy_webui(self): |
| 143 | """Build frontend and copy webui files to build directory""" |