@@ -230,11 +230,24 @@ def tests_build_wheel(monkeypatch, tmpdir):
230
230
231
231
with zipfile .ZipFile (str (wheel )) as z :
232
232
names = z .namelist ()
233
+ share = zipfile .Path (z , "pybind11/share" )
234
+ pkgconfig = (share / "pkgconfig/pybind11.pc" ).read_text (encoding = "utf-8" )
235
+ cmakeconfig = (share / "cmake/pybind11/pybind11Config.cmake" ).read_text (
236
+ encoding = "utf-8"
237
+ )
233
238
234
239
trimmed = {n for n in names if "dist-info" not in n }
235
240
trimmed |= {f"dist-info/{ n .split ('/' , 1 )[- 1 ]} " for n in names if "dist-info" in n }
241
+
236
242
assert files == trimmed
237
243
244
+ assert 'set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")' in cmakeconfig
245
+
246
+ version = wheel .basename .split ("-" )[1 ]
247
+ simple_version = "." .join (version .split ("." )[:3 ])
248
+ pkgconfig_expected = PKGCONFIG .format (VERSION = simple_version )
249
+ assert pkgconfig_expected == pkgconfig
250
+
238
251
239
252
def tests_build_global_wheel (monkeypatch , tmpdir ):
240
253
monkeypatch .chdir (MAIN_DIR )
@@ -258,8 +271,21 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
258
271
259
272
with zipfile .ZipFile (str (wheel )) as z :
260
273
names = z .namelist ()
274
+ beginning = names [0 ].split ("/" , 1 )[0 ].rsplit ("." , 1 )[0 ]
275
+
276
+ share = zipfile .Path (z , f"{ beginning } .data/data/share" )
277
+ pkgconfig = (share / "pkgconfig/pybind11.pc" ).read_text (encoding = "utf-8" )
278
+ cmakeconfig = (share / "cmake/pybind11/pybind11Config.cmake" ).read_text (
279
+ encoding = "utf-8"
280
+ )
261
281
262
- beginning = names [0 ].split ("/" , 1 )[0 ].rsplit ("." , 1 )[0 ]
263
282
trimmed = {n [len (beginning ) + 1 :] for n in names }
264
283
265
284
assert files == trimmed
285
+
286
+ assert 'set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/include")' in cmakeconfig
287
+
288
+ version = wheel .basename .split ("-" )[1 ]
289
+ simple_version = "." .join (version .split ("." )[:3 ])
290
+ pkgconfig_expected = PKGCONFIG .format (VERSION = simple_version )
291
+ assert pkgconfig_expected == pkgconfig
0 commit comments