Skip to content

Commit

Permalink
Cleanup for validate cache in get-generic-python-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
arjunsuresh committed Nov 25, 2024
1 parent 834c256 commit c4fd10f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
19 changes: 12 additions & 7 deletions automation/script/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -1184,6 +1184,7 @@ def _run(self, i):
'recursion_spaces': recursion_spaces,
'script_tags': script_tags,
'found_script_tags': found_script_tags,
'found_script_path': path,
'variation_tags': variation_tags,
'explicit_variation_tags': explicit_variation_tags,
'version': version,
Expand Down Expand Up @@ -5019,23 +5020,27 @@ def find_cached_script(i):
skip_cached_script = True
continue

if os.path.exists(os.path.join(cached_script.path, "validate.sh")):
os_info = self_obj.os_info
os_info = self_obj.os_info

# Bat extension for this host OS
bat_ext = os_info['bat_ext']
# Bat extension for this host OS
bat_ext = os_info['bat_ext']
script_path = i['found_script_path']

if os.path.exists(os.path.join(script_path, f"validate_cache{bat_ext}")):
run_script_input = {
'path': cached_script.path,
'path': script_path,
'bat_ext': bat_ext,
'os_info': os_info,
'recursion_spaces': recursion_spaces,
'tmp_file_run': self_obj.tmp_file_run,
'self': self_obj,
'meta': i['meta']
'meta': meta
}
ii = {'run_script_input': run_script_input, 'env': env, 'script_name': 'validate'}
ii = {'run_script_input': run_script_input, 'env': env, 'script_name': 'validate_cache'}
r = self_obj.run_native_script(ii)

if r['return'] > 0:
#return r
continue

if not skip_cached_script:
Expand Down
3 changes: 0 additions & 3 deletions script/get-generic-python-lib/customize.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from cmind import utils
import os
import cmind as cm
import shutil

def preprocess(i):

Expand Down Expand Up @@ -179,6 +178,4 @@ def postprocess(i):
if pip_version and len(pip_version) > 1 and int(pip_version[0]) >= 23:
env['CM_PYTHON_PIP_COMMON_EXTRA'] = " --break-system-packages"

shutil.copyfile(os.path.join(env['CM_TMP_CURRENT_SCRIPT_PATH'], "run.sh"), "validate.sh")

return {'return': 0, 'version': version}

0 comments on commit c4fd10f

Please sign in to comment.