1515 )
1616 cache_dir = pooch .os_cache ("echopype" )
1717
18+ print (
19+ "\n [echopype-ci] POOCH CONFIG\n "
20+ f" USE_POOCH = { os .getenv ('USE_POOCH' )} \n "
21+ f" ECHOPYPE_DATA_VERSION = { ver } \n "
22+ f" ECHOPYPE_DATA_BASEURL = { base } \n "
23+ f" pooch cache_dir = { cache_dir } \n " ,
24+ flush = True ,
25+ )
26+
1827 bundles = [
1928 "ad2cp.zip" , "azfp.zip" , "azfp6.zip" , "ea640.zip" , "ecs.zip" , "ek60.zip" ,
2029 "ek60_calibrate_chunks.zip" , "ek60_missing_channel_power.zip" , "ek80.zip" ,
6069 def _unpack (fname , action , pooch_instance ):
6170 z = Path (fname )
6271 out = z .parent / z .stem
72+
73+ print (
74+ "\n [echopype-ci] UNPACK\n "
75+ f" zip file = { z } \n "
76+ f" action = { action } \n "
77+ f" extract_to = { out } \n " ,
78+ flush = True ,
79+ )
80+
6381 if action in ("update" , "download" ) or not out .exists ():
6482 from zipfile import ZipFile
83+
6584 with ZipFile (z , "r" ) as f :
6685 f .extractall (out )
6786
6887 # flatten single nested dir if needed
6988 try :
70- entries = [ p for p in out .iterdir ()]
89+ entries = list ( out .iterdir ())
7190 if len (entries ) == 1 and entries [0 ].is_dir ():
7291 inner = entries [0 ]
7392 for child in inner .iterdir ():
@@ -80,12 +99,42 @@ def _unpack(fname, action, pooch_instance):
8099 pass
81100 except Exception :
82101 pass
102+
103+ # Print tree after extraction/flatten
104+ try :
105+ if out .exists ():
106+ print ("[echopype-ci] extracted tree (depth ≤ 2):" )
107+ for p in sorted (out .glob ("*" )):
108+ print (f" - { p .name } " )
109+ if p .is_dir ():
110+ for q in sorted (p .glob ("*" )):
111+ print (f" • { q .name } " )
112+ except Exception :
113+ pass
114+
83115 return str (out )
84116
117+
85118 for b in bundles :
119+ url = base .format (version = ver ) + b
120+ print (f"[echopype-ci] fetching bundle: { b } " )
121+ print (f"[echopype-ci] → URL: { url } " )
86122 EP .fetch (b , processor = _unpack , progressbar = False )
87123
88124 TEST_DATA_FOLDER = Path (cache_dir ) / ver
125+
126+ print (
127+ "\n [echopype-ci] TEST_DATA_FOLDER\n "
128+ f" path = { TEST_DATA_FOLDER } \n "
129+ f" exists = { TEST_DATA_FOLDER .exists ()} \n " ,
130+ flush = True ,
131+ )
132+
133+ if TEST_DATA_FOLDER .exists ():
134+ print ("[echopype-ci] top-level contents:" )
135+ for p in sorted (TEST_DATA_FOLDER .iterdir ()):
136+ print (f" - { p .name } " )
137+
89138
90139@pytest .fixture (scope = "session" )
91140def dump_output_dir ():
0 commit comments