@@ -246,17 +246,38 @@ def tests_build_wheel(monkeypatch, tmpdir):
246
246
247
247
with zipfile .ZipFile (str (wheel )) as z :
248
248
names = z .namelist ()
249
+ share = zipfile .Path (z , "pybind11/share" )
250
+ pkgconfig = (share / "pkgconfig/pybind11.pc" ).read_text (encoding = "utf-8" )
251
+ cmakeconfig = (share / "cmake/pybind11/pybind11Config.cmake" ).read_text (
252
+ encoding = "utf-8"
253
+ )
249
254
250
255
trimmed = {n for n in names if "dist-info" not in n }
251
256
trimmed |= {f"dist-info/{ n .split ('/' , 1 )[- 1 ]} " for n in names if "dist-info" in n }
257
+
252
258
assert files == trimmed
253
259
260
+ assert 'set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")' in cmakeconfig
261
+
262
+ version = wheel .basename .split ("-" )[1 ]
263
+ simple_version = "." .join (version .split ("." )[:3 ])
264
+ pkgconfig_expected = PKGCONFIG .format (VERSION = simple_version )
265
+ assert pkgconfig_expected == pkgconfig
266
+
254
267
255
268
def tests_build_global_wheel (monkeypatch , tmpdir ):
256
269
monkeypatch .chdir (MAIN_DIR )
257
270
with build_global ():
258
271
subprocess .run (
259
- [sys .executable , "-m" , "pip" , "wheel" , "." , "-w" , str (tmpdir ), * UV_ARGS ],
272
+ [
273
+ sys .executable ,
274
+ "-m" ,
275
+ "build" ,
276
+ "--wheel" ,
277
+ "--outdir" ,
278
+ str (tmpdir ),
279
+ * UV_ARGS ,
280
+ ],
260
281
check = True ,
261
282
)
262
283
@@ -274,8 +295,21 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
274
295
275
296
with zipfile .ZipFile (str (wheel )) as z :
276
297
names = z .namelist ()
298
+ beginning = names [0 ].split ("/" , 1 )[0 ].rsplit ("." , 1 )[0 ]
299
+
300
+ share = zipfile .Path (z , f"{ beginning } .data/data/share" )
301
+ pkgconfig = (share / "pkgconfig/pybind11.pc" ).read_text (encoding = "utf-8" )
302
+ cmakeconfig = (share / "cmake/pybind11/pybind11Config.cmake" ).read_text (
303
+ encoding = "utf-8"
304
+ )
277
305
278
- beginning = names [0 ].split ("/" , 1 )[0 ].rsplit ("." , 1 )[0 ]
279
306
trimmed = {n [len (beginning ) + 1 :] for n in names }
280
307
281
308
assert files == trimmed
309
+
310
+ assert 'set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")' in cmakeconfig
311
+
312
+ version = wheel .basename .split ("-" )[1 ]
313
+ simple_version = "." .join (version .split ("." )[:3 ])
314
+ pkgconfig_expected = PKGCONFIG .format (VERSION = simple_version )
315
+ assert pkgconfig_expected == pkgconfig
0 commit comments