@@ -183,12 +183,12 @@ def stamp(tmp_path, monkeypatch):
183183 scratch = tmp_path / "build" / ".build-config"
184184 monkeypatch .setattr (build_hooks , "_BUILD_CONFIG_STAMP" , scratch )
185185 monkeypatch .setattr (build_hooks , "force_build_ext" , False )
186- monkeypatch .setattr (build_hooks , "_last_build_config" , None )
187186 build_hooks ._get_cuda_path .cache_clear ()
188187 build_hooks ._determine_cuda_major_version .cache_clear ()
189188 get_cuda_path_or_home .cache_clear ()
190189 monkeypatch .setenv ("CUDA_CORE_BUILD_MAJOR" , "13" )
191190 monkeypatch .delenv ("CUDA_PYTHON_TOOLCHAIN" , raising = False )
191+ monkeypatch .delenv ("CUDA_PYTHON_COVERAGE" , raising = False )
192192 return scratch
193193
194194
@@ -203,54 +203,49 @@ class TestBuildConfigStamp:
203203 @pytest .mark .agent_authored (model = "glm-5.2" )
204204 def test_missing_stamp_forces_rebuild (self , stamp ):
205205 # No stamp means the last build's config is unknown, so rebuild.
206- assert build_hooks ._check_build_config ("gnu" , False , False ) == "13"
206+ cuda_major , key = build_hooks ._check_build_config ("gnu" , False , False )
207+ assert cuda_major == "13"
208+ assert key == "cu13-gnu-opt"
207209 assert build_hooks .force_build_ext is True
208210
209211 @pytest .mark .agent_authored (model = "glm-5.2" )
210212 def test_same_config_does_not_force (self , stamp ):
211213 _write_stamp (stamp , "cu13-gnu-opt" )
212- assert build_hooks ._check_build_config ("gnu" , False , False ) == "13"
214+ cuda_major , key = build_hooks ._check_build_config ("gnu" , False , False )
215+ assert cuda_major == "13"
213216 assert build_hooks .force_build_ext is False
214217
215218 @pytest .mark .agent_authored (model = "glm-5.2" )
216219 def test_changed_cuda_major_forces_rebuild (self , stamp ):
217220 _write_stamp (stamp , "cu12-gnu-opt" )
218- assert build_hooks ._check_build_config ("gnu" , False , False ) == "13"
221+ cuda_major , _ = build_hooks ._check_build_config ("gnu" , False , False )
222+ assert cuda_major == "13"
219223 assert build_hooks .force_build_ext is True
220224
221225 @pytest .mark .agent_authored (model = "glm-5.2" )
222226 def test_changed_toolchain_forces_rebuild (self , stamp ):
223227 _write_stamp (stamp , "cu13-gnu-opt" )
224- assert build_hooks ._check_build_config ("llvm" , False , False ) == "13"
228+ build_hooks ._check_build_config ("llvm" , False , False )
225229 assert build_hooks .force_build_ext is True
226230
227231 @pytest .mark .agent_authored (model = "glm-5.2" )
228232 def test_changed_debug_forces_rebuild (self , stamp ):
229233 _write_stamp (stamp , "cu13-gnu-opt" )
230- assert build_hooks ._check_build_config ("gnu" , True , False ) == "13"
234+ build_hooks ._check_build_config ("gnu" , True , False )
231235 assert build_hooks .force_build_ext is True
232236
233237 @pytest .mark .agent_authored (model = "glm-5.2" )
234238 def test_changed_coverage_forces_rebuild (self , stamp ):
235239 _write_stamp (stamp , "cu13-gnu-opt" )
236- assert build_hooks ._check_build_config ("gnu" , False , True ) == "13"
240+ build_hooks ._check_build_config ("gnu" , False , True )
237241 assert build_hooks .force_build_ext is True
238242
239243 @pytest .mark .agent_authored (model = "glm-5.2" )
240244 def test_record_writes_stamp (self , stamp ):
241- # _check_build_config sets _last_build_config; record writes it.
242- build_hooks ._check_build_config ("gnu" , False , False )
243- build_hooks .record_build_config ()
245+ # record_build_config re-derives from env; pass debug=False to match.
246+ build_hooks .record_build_config (False )
244247 assert stamp .read_text ().strip () == "cu13-gnu-opt"
245248
246- @pytest .mark .agent_authored (model = "glm-5.2" )
247- def test_record_without_check_is_noop (self , stamp , monkeypatch ):
248- # If the build never reached _check_build_config (e.g. metadata-only),
249- # record_build_config must not write a stamp.
250- monkeypatch .setattr (build_hooks , "_last_build_config" , None )
251- build_hooks .record_build_config ()
252- assert not stamp .exists ()
253-
254249
255250def _capture_cythonize_build_dir (monkeypatch , cuda_major ):
256251 """Run the cythonize setup for one CUDA major and report its build_dir.
0 commit comments