Skip to content

Commit e45fa5b

Browse files
committed
Refactor: suppression du workspace_hash (redondant avec Git et risque de briser la reproductibilité)
1 parent 4f1d90e commit e45fa5b

1 file changed

Lines changed: 0 additions & 20 deletions

File tree

Core/Locking/__init__.py

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -127,24 +127,6 @@ def _matches_exclude_pattern(relative_path: str, pattern: str) -> bool:
127127
return fnmatch.fnmatch(rel, pat) or Path(rel).match(pat)
128128

129129

130-
def compute_workspace_hash(workspace: Path, exclude_patterns: list[str]) -> str:
131-
"""
132-
Compute a fast hash of the workspace using file metadata (path, size, mtime).
133-
This is much faster than reading full content for large projects.
134-
"""
135-
digest = sha256()
136-
for path in included_workspace_files(workspace, exclude_patterns):
137-
try:
138-
stat = path.stat()
139-
# We hash the relative path, size, and mtime
140-
rel = path.relative_to(workspace).as_posix()
141-
entry = f"{rel}|{stat.st_size}|{stat.st_mtime}"
142-
digest.update(entry.encode("utf-8"))
143-
except Exception:
144-
continue
145-
return "metadata-sha256:" + digest.hexdigest()
146-
147-
148130
def get_git_commit_hash(workspace: Path) -> str | None:
149131
"""Return the current Git commit hash of the workspace if available."""
150132
try:
@@ -238,7 +220,6 @@ def build_lock_payload(
238220
"python_version": python_version or platform.python_version(),
239221
},
240222
"dependencies": dependencies or installed_distributions_snapshot(),
241-
"workspace_hash": compute_workspace_hash(workspace, exclude_patterns),
242223
}
243224

244225

@@ -320,7 +301,6 @@ def build_context_from_lock(lock_payload: dict[str, Any]) -> BuildContext:
320301
"build_lock_payload",
321302
"cache_rebuild_lock",
322303
"compare_lock_payloads",
323-
"compute_workspace_hash",
324304
"default_lock_path",
325305
"engine_config_path",
326306
"ensure_workspace_layout",

0 commit comments

Comments
 (0)