@@ -11,7 +11,7 @@ def main() -> None:
11
11
files_to_run = calculate_shards (all_files , num_shards = 20 )[int (os .environ .get ("WORKER_ID" , "1" )) - 1 ]
12
12
files_to_run = [x for x in files_to_run if x not in [f"{ f } .py" for f in NOT_RUN ]]
13
13
14
- os .makedirs ("docs_to_zip" , exist_ok = True )
14
+ os .makedirs ("/tmp/ docs_to_zip" , exist_ok = True )
15
15
16
16
env = os .environ .copy ()
17
17
for file in files_to_run :
@@ -23,11 +23,11 @@ def main() -> None:
23
23
subprocess .check_output (["make" , "postprocess" ], env = env )
24
24
for file in glob .glob (f"docs/**/*" , recursive = True ):
25
25
if stem in file :
26
- os .makedirs (os .path .dirname (f"docs_to_zip/{ file } " ), exist_ok = True )
27
- shutil .copy (file , f"docs_to_zip/{ file } " )
26
+ relative_path = Path (os .path .relpath (file , "docs" ))
27
+ os .makedirs (os .path .dirname (f"docs_to_zip/{ relative_path .parent } " ), exist_ok = True )
28
+ shutil .copy (file , f"/tmp/docs_to_zip/{ relative_path } " )
28
29
subprocess .check_output (["git" , "reset" , "--hard" , "HEAD" ])
29
- os .remove ("docs" )
30
- shutil .move ("docs_to_zip" , "docs" )
30
+ shutil .move ("/tmp/docs_to_zip" , "docs" )
31
31
32
32
if __name__ == "__main__" :
33
33
main ()
0 commit comments