Skip to content

Commit ff09147

Browse files
committed
chore: do not use f-strings in logger calls.
Signed-off-by: habeck <habeck@us.ibm.com>
1 parent f78b4be commit ff09147

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

cpex/framework/isolated/client.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ def _is_venv_cache_valid(self, venv_path: str, requirements_file: str) -> bool:
9797

9898
# Check if venv directory exists
9999
if not venv_path_obj.exists():
100-
logger.debug(f"Venv path does not exist: {venv_path}")
100+
logger.debug("Venv path does not exist: %s", venv_path)
101101
return False
102102

103103
# Check if metadata file exists
104104
if not metadata_path.exists():
105-
logger.debug(f"Metadata file does not exist: {metadata_path}")
105+
logger.debug("Metadata file does not exist: %s", metadata_path)
106106
return False
107107

108108
try:
@@ -116,14 +116,14 @@ def _is_venv_cache_valid(self, venv_path: str, requirements_file: str) -> bool:
116116
# Compare hashes
117117
cached_hash = metadata.get("requirements_hash")
118118
if cached_hash != current_hash:
119-
logger.info(f"Requirements changed. Cached hash: {cached_hash}, Current hash: {current_hash}")
119+
logger.info("Requirements changed. Cached hash: %s, Current hash: %s",cached_hash, current_hash)
120120
return False
121121

122-
logger.info(f"Valid venv cache found for {venv_path}")
122+
logger.info("Valid venv cache found for %s", venv_path)
123123
return True
124124

125125
except (json.JSONDecodeError, KeyError) as e:
126-
logger.warning(f"Error reading cache metadata: {e}")
126+
logger.warning("Error reading cache metadata: %s", str(e))
127127
return False
128128

129129
def _save_cache_metadata(self, venv_path: str, requirements_file: str) -> None:
@@ -146,7 +146,7 @@ def _save_cache_metadata(self, venv_path: str, requirements_file: str) -> None:
146146
with open(metadata_path, "w", encoding="utf8") as f:
147147
json.dump(metadata, f, indent=2)
148148

149-
logger.info(f"Saved cache metadata to {metadata_path}")
149+
logger.info("Saved cache metadata to %s", metadata_path)
150150

151151
async def create_venv(
152152
self, venv_path: str = ".venv", requirements_file: Optional[str] = None, use_cache: bool = True
@@ -162,13 +162,13 @@ async def create_venv(
162162

163163
# Check if we can use cached venv
164164
if use_cache and requirements_file and self._is_venv_cache_valid(venv_path, requirements_file):
165-
logger.info(f"Using cached virtual environment at: {venv_path_obj.resolve()}")
165+
logger.info("Using cached virtual environment at: %s", venv_path_obj.resolve())
166166
print(f"✓ Using cached virtual environment at: {venv_path_obj.resolve()}")
167167
return
168168

169169
# If cache is invalid or not using cache, remove existing venv
170170
if venv_path_obj.exists():
171-
logger.info(f"Removing existing venv at {venv_path}")
171+
logger.info("Removing existing venv at %s", venv_path)
172172
shutil.rmtree(venv_path_obj)
173173

174174
# Check Python version

0 commit comments

Comments
 (0)