1717RELEASE = platform .release ()
1818PYCDS_ROOT = os .path .dirname (__file__ )
1919
20+ GA = os .environ .get ('GITHUB_ACTIONS' ) == 'true'
21+
2022CDS_PYPERFORMANCE = 'git+https://github.com/oraluben/pyperformance.git@cds'
2123
2224
25+ def _clean_nox ():
26+ from nox .virtualenv import shutil
27+
28+ shutil .rmtree (os .path .join (PYCDS_ROOT , '.nox' ), ignore_errors = True )
29+
30+
31+ def ci_session_cleanup ():
32+ if OS == 'Windows' and GA :
33+ _clean_nox ()
34+
35+
2336def _py_version (session : nox .Session ):
2437 """
2538 :return: "3.9", "3.10", ...
@@ -132,9 +145,11 @@ def test_import_third_party(session: nox.Session, package):
132145 img = os .path .join (tmp , 'test.img' )
133146
134147 session .run ('python' , '-c' , package .import_stmt , env = {'PYCDSMODE' : 'TRACE' , 'PYCDSLIST' : lst })
135- session .run ('python' , '-c' , f'import cds.dump; cds.dump.run_dump(" { lst } ", " { img } " )' )
148+ session .run ('python' , '-c' , f'import cds.dump; cds.dump.run_dump({ repr ( lst ) } , { repr ( img ) } )' )
136149 session .run ('python' , '-c' , package .import_stmt , env = {'PYCDSMODE' : 'SHARE' , 'PYCDSARCHIVE' : img })
137150
151+ ci_session_cleanup ()
152+
138153
139154 @nox .session (name = f'test_import_third_party_perf-{ py } ' , tags = ['test_import_third_party_perf' ], python = py )
140155 @nox .parametrize ('package' , [package for package in PACKAGES if not package .should_skip (py )])
@@ -158,7 +173,7 @@ def test_import_third_party_perf(session: nox.Session, package):
158173
159174 logger .info (f'start generating CDS archive for { package .name } ' )
160175 session .run ('python' , '-c' , package .import_stmt , env = {'PYCDSMODE' : 'TRACE' , 'PYCDSLIST' : lst }, log = False )
161- session .run ('python' , '-c' , f'import cds.dump; cds.dump.run_dump(" { lst } ", " { img } " )' , log = False )
176+ session .run ('python' , '-c' , f'import cds.dump; cds.dump.run_dump({ repr ( lst ) } , { repr ( img ) } )' , log = False )
162177 session .run ('python' , '-c' , package .import_stmt , env = {'PYCDSMODE' : 'SHARE' , 'PYCDSARCHIVE' : img }, log = False )
163178 logger .info (f'finish generating CDS archive for { package .name } ' )
164179
@@ -172,6 +187,8 @@ def test_import_third_party_perf(session: nox.Session, package):
172187 'python' , '-c' , package .import_stmt ,
173188 env = {'PYCDSMODE' : 'SHARE' , 'PYCDSARCHIVE' : img })
174189
190+ ci_session_cleanup ()
191+
175192
176193def _pyperformance (session : nox .Session , pyperformance_args = None ):
177194 session .install (CDS_PYPERFORMANCE )
0 commit comments