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