@@ -308,7 +308,6 @@ def bash_render(folder: str) -> str:
308308 ipynb_file , meta_file , thumb_file = AssistantCLI ._valid_folder (folder , ext = ".ipynb" )
309309 pub_ipynb = os .path .join (DIR_NOTEBOOKS , f"{ folder } .ipynb" )
310310 pub_dir = os .path .dirname (pub_ipynb )
311- pub_meta = os .path .join (DIR_NOTEBOOKS , f"{ folder } .yaml" )
312311 thumb_ext = os .path .splitext (thumb_file )[- 1 ] if thumb_file else "."
313312 pub_thumb = os .path .join (DIR_NOTEBOOKS , f"{ folder } { thumb_ext } " ) if thumb_file else ""
314313 cmd .append (f"mkdir -p { pub_dir } " )
@@ -325,9 +324,9 @@ def bash_render(folder: str) -> str:
325324 warn ("Invalid notebook's accelerator for this device. So no outputs will be generated." , RuntimeWarning )
326325 cmd .append (f"cp { ipynb_file } { pub_ipynb } " )
327326 # Export the actual packages used in runtime
328- cmd .append (f"python .actions/assistant.py update-env-details { folder } " )
327+ cmd .append (f"meta_file=$( python .actions/assistant.py update-env-details { folder } ) " )
329328 # copy and add to version the enriched meta config
330- cmd += [f"cp { meta_file } { pub_meta } " , f "git add { pub_meta } " ]
329+ cmd += ["echo $ meta_file" , "cat $meta_file" , "git add $meta_file " ]
331330 # if thumb image is linked to the notebook, copy and version it too
332331 if thumb_file :
333332 cmd += [f"cp { thumb_file } { pub_thumb } " , f"git add { pub_thumb } " ]
@@ -358,6 +357,10 @@ def bash_test(folder: str) -> str:
358357 # and install specific packages
359358 pip_req , pip_args = AssistantCLI ._parse_requirements (folder )
360359 cmd += [f"pip install { pip_req } { pip_args } " , "pip list" ]
360+ # Export the actual packages used in runtime
361+ cmd .append (f"meta_file=$(python .actions/assistant.py update-env-details { folder } --base_path .)" )
362+ # show created meta config
363+ cmd += ["echo $meta_file" , "cat $meta_file" ]
361364
362365 cmd .append (f"# available: { AssistantCLI .DEVICE_ACCELERATOR } " )
363366 if AssistantCLI ._valid_accelerator (folder ):
@@ -369,7 +372,7 @@ def bash_test(folder: str) -> str:
369372 return os .linesep .join (cmd )
370373
371374 @staticmethod
372- def augment_script (folder : str ) -> None :
375+ def convert_ipynb (folder : str ) -> None :
373376 """Add template header and footer to the python base script.
374377
375378 Args:
@@ -609,7 +612,7 @@ def copy_notebooks(
609612 ipynb_content .append (os .path .join ("notebooks" , sub_ipynb ))
610613
611614 @staticmethod
612- def update_env_details (folder : str ) -> None :
615+ def update_env_details (folder : str , base_path : str = DIR_NOTEBOOKS ) -> str :
613616 """Export the actual packages used in runtime.
614617
615618 Args:
@@ -636,8 +639,9 @@ def _parse_package_name(pkg: str, keys: str = " <=>[]@", egg_name: str = "#egg="
636639 meta ["environment" ] = [env [r ] for r in require ]
637640 meta ["published" ] = datetime .now ().isoformat ()
638641
639- fmeta = os .path .join (DIR_NOTEBOOKS , folder ) + ".yaml"
642+ fmeta = os .path .join (base_path , folder ) + ".yaml"
640643 yaml .safe_dump (meta , stream = open (fmeta , "w" ), sort_keys = False )
644+ return fmeta
641645
642646 @staticmethod
643647 def list_dirs (folder : str = "" , include_file_ext : str = "" ) -> str :
0 commit comments