diff --git a/setup.py b/setup.py index 1d68190d..f5276a2b 100644 --- a/setup.py +++ b/setup.py @@ -46,6 +46,7 @@ 'pykwalify', 'setuptools', 'packaging', + 'joblib' ], python_requires='>=3.8', entry_points={'console_scripts': ('west = west.app.main:main',)}, diff --git a/src/west/app/project.py b/src/west/app/project.py index a046b65c..a7a4c9ab 100644 --- a/src/west/app/project.py +++ b/src/west/app/project.py @@ -6,6 +6,7 @@ '''West project commands''' import argparse +from joblib import Parallel, delayed from functools import partial import logging import os @@ -1018,18 +1019,22 @@ def update_all(self): import_flags=ImportFlag.FORCE_PROJECTS) failed = [] - for project in self.manifest.projects: + + def project_update(project): if (isinstance(project, ManifestProject) or project.name in self.updated): - continue + return try: if not self.project_is_active(project): self.dbg(f'{project.name}: skipping inactive project') - continue - self.update(project) + return self.updated.add(project.name) + self.update(project) except subprocess.CalledProcessError: failed.append(project) + + Parallel(n_jobs=-1, require='sharedmem')(delayed(project_update)(project) + for project in self.manifest.projects) self._handle_failed(self.args, failed) def update_importer(self, project, path): @@ -1090,13 +1095,17 @@ def update_some(self): projects = self._projects(self.args.projects) failed = [] - for project in projects: + + def project_update_some(project): if isinstance(project, ManifestProject): - continue + return try: self.update(project) except subprocess.CalledProcessError: failed.append(project) + + Parallel(n_jobs=-1, require='sharedmem')(delayed(project_update_some)(project) + for project in projects) self._handle_failed(self.args, failed) def toplevel_projects(self):