From 8dc0e1096930503950b2b9206729c0a46f90e27e Mon Sep 17 00:00:00 2001 From: TheOnePath Date: Sat, 12 Aug 2023 16:35:33 +0100 Subject: [PATCH] Updated operations.py Operation functions now take the transaction object as an input. Annotation is provided using the TYPE_CHECKING constant. Added more logging statements. --- soypak/deps/operations.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/soypak/deps/operations.py b/soypak/deps/operations.py index 4d960c7..607c6b9 100644 --- a/soypak/deps/operations.py +++ b/soypak/deps/operations.py @@ -1,15 +1,22 @@ import sys import clog +import typing import soypak.deps.bottler as bottler +if typing.TYPE_CHECKING: + import soypak.deps.transaction as transaction + _log = clog.Logger.get("runtime_logger") -def install_packages(pkgs: list[bottler.PackageItem]): +def install_packages(tx: transaction.Transaction, pkgs: list[bottler.PackageItem]): + _log.debug(f"The transaction goal is {tx.pkg_goal=}. Attempting to perform installation.") if not isinstance(pkgs, bottler.PackageItem): _log.error(f"TypeError: {pkgs=}, expected list[PackageItem].") _log.printLog("There was an issue when operating on the transaction.", level=4) sys.exit(1) # :@TODO: install the damned things! + + _log.debug("Installation of packages is complete. Ensure to resolve problems within the transaction.")