@@ -122,16 +122,17 @@ def _get_modified_env(session):
122122 cflags = " " .join (flag for flag in out .split () if flag != "-g" )
123123 env = os .environ .copy ()
124124 env ["CFLAGS" ] = cflags
125+ return env
125126
126127
127128@nox .session
128129def test_with_fft_and_pythran (session ):
129130 print_times = TimePrinter ()
130131
132+ env_modif = _get_modified_env (session )
133+
131134 command = "pdm sync --clean -G dev -G test -G fft -G mpi --no-self"
132- session .run_install (
133- * command .split (), external = True , env = _get_modified_env (session )
134- )
135+ session .run_install (* command .split (), external = True , env = env_modif )
135136
136137 print_times ("pdm sync" )
137138
@@ -146,7 +147,9 @@ def test_with_fft_and_pythran(session):
146147 if "GITLAB_CI" in os .environ :
147148 short_names .extend (["pfft" , "p3dfft" ])
148149 for short_name in short_names :
149- session .install (f"fluidfft-{ short_name } " )
150+ session .run_install (
151+ "pip" , "install" , f"fluidfft-{ short_name } " , "-v" , env = env_modif
152+ )
150153
151154 _test (session )
152155
@@ -156,17 +159,16 @@ def test_with_fft_and_pythran(session):
156159@nox .session (name = "test-examples" )
157160def test_examples (session ):
158161 """Execute the examples using pytest"""
162+ env_modif = _get_modified_env (session )
159163
160164 command = "pdm sync --clean -G test -G mpi -G fft -G dev --no-self"
161- session .run_install (
162- * command .split (), external = True , env = _get_modified_env (session )
163- )
165+ session .run_install (* command .split (), external = True , env = env_modif )
164166
165167 command = "."
166168 if "GITLAB_CI" in os .environ :
167169 command += " -C compile-args=-j1"
168170 session .install (* command .split ())
169- session .install ("fluidfft-fftwmpi" )
171+ session .install ("fluidfft-fftwmpi" , env = env_modif )
170172
171173 session .chdir ("doc/examples" )
172174 session .run ("make" , "test" , external = True )
0 commit comments