@@ -246,11 +246,24 @@ 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 )
@@ -274,8 +287,21 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
274
287
275
288
with zipfile .ZipFile (str (wheel )) as z :
276
289
names = z .namelist ()
290
+ beginning = names [0 ].split ("/" , 1 )[0 ].rsplit ("." , 1 )[0 ]
291
+
292
+ share = zipfile .Path (z , f"{ beginning } .data/data/share" )
293
+ pkgconfig = (share / "pkgconfig/pybind11.pc" ).read_text (encoding = "utf-8" )
294
+ cmakeconfig = (share / "cmake/pybind11/pybind11Config.cmake" ).read_text (
295
+ encoding = "utf-8"
296
+ )
277
297
278
- beginning = names [0 ].split ("/" , 1 )[0 ].rsplit ("." , 1 )[0 ]
279
298
trimmed = {n [len (beginning ) + 1 :] for n in names }
280
299
281
300
assert files == trimmed
301
+
302
+ assert 'set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")' in cmakeconfig
303
+
304
+ version = wheel .basename .split ("-" )[1 ]
305
+ simple_version = "." .join (version .split ("." )[:3 ])
306
+ pkgconfig_expected = PKGCONFIG .format (VERSION = simple_version )
307
+ assert pkgconfig_expected == pkgconfig
0 commit comments