Skip to content

Commit da5c90b

Browse files
committed
publish improvements
1 parent 835cef5 commit da5c90b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

publish.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,17 @@ def clear_component_cache(self, component):
19861986

19871987
if os.path.exists(sam_dir):
19881988
self.log_verbose(f"Clearing entire SAM cache for {component}: {sam_dir}")
1989-
shutil.rmtree(sam_dir)
1989+
try:
1990+
shutil.rmtree(sam_dir)
1991+
except (FileNotFoundError, OSError) as e:
1992+
self.log_verbose(
1993+
f"Warning: Error clearing SAM cache (may already be deleted): {e}"
1994+
)
1995+
# Try alternative cleanup method for broken symlinks
1996+
try:
1997+
subprocess.run(["rm", "-rf", sam_dir], check=False)
1998+
except Exception as e2:
1999+
self.log_verbose(f"Alternative cleanup also failed: {e2}")
19902000

19912001
def _validate_python_syntax(self, directory):
19922002
"""Validate Python syntax in all .py files in the directory"""
@@ -2042,7 +2052,7 @@ def build_lib_package(self):
20422052
raise Exception("Python syntax validation failed")
20432053

20442054
result = subprocess.run(
2045-
["python", "setup.py", "build"],
2055+
[sys.executable, "setup.py", "build"],
20462056
cwd=lib_dir,
20472057
capture_output=True,
20482058
text=True,

0 commit comments

Comments
 (0)