From 730a8341e901788f1b324fc9ea09dde7f3a8cdab Mon Sep 17 00:00:00 2001 From: ryanking13 Date: Tue, 19 Sep 2023 22:13:21 +0900 Subject: [PATCH] Fix keep going --- micropip/transaction.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/micropip/transaction.py b/micropip/transaction.py index a3663a6..c2fffbd 100644 --- a/micropip/transaction.py +++ b/micropip/transaction.py @@ -308,7 +308,8 @@ def eval_marker(e: dict[str, str]) -> bool: raise except ValueError: self.failed.append(req) - raise + if not self.keep_going: + raise def _add_requirement_from_pyodide_lock(self, req: Requirement) -> bool: """ @@ -326,7 +327,7 @@ def _add_requirement_from_pyodide_lock(self, req: Requirement) -> bool: return False - async def _add_requirement_from_package_index(self, req: Requirement) -> bool: + async def _add_requirement_from_package_index(self, req: Requirement): """ Find requirement from package index. If the requirement is found, add it to the package list and return True. Otherwise, return False. @@ -335,23 +336,15 @@ async def _add_requirement_from_package_index(self, req: Requirement) -> bool: req.name, self.fetch_kwargs, index_urls=self.index_urls ) - try: - wheel = find_wheel(metadata, req) - except ValueError: - if not self.keep_going: - raise - else: - return False + wheel = find_wheel(metadata, req) # Maybe while we were downloading pypi_json some other branch # installed the wheel? satisfied, ver = self.check_version_satisfied(req) if satisfied: logger.info(f"Requirement already satisfied: {req} ({ver})") - return True await self.add_wheel(wheel, req.extras, specifier=str(req.specifier)) - return True async def add_wheel( self,