@@ -230,11 +230,24 @@ def tests_build_wheel(monkeypatch, tmpdir):
230230
231231 with zipfile .ZipFile (str (wheel )) as z :
232232 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+ )
233238
234239 trimmed = {n for n in names if "dist-info" not in n }
235240 trimmed |= {f"dist-info/{ n .split ('/' , 1 )[- 1 ]} " for n in names if "dist-info" in n }
241+
236242 assert files == trimmed
237243
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+
238251
239252def tests_build_global_wheel (monkeypatch , tmpdir ):
240253 monkeypatch .chdir (MAIN_DIR )
@@ -258,8 +271,21 @@ def tests_build_global_wheel(monkeypatch, tmpdir):
258271
259272 with zipfile .ZipFile (str (wheel )) as z :
260273 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+ )
261281
262- beginning = names [0 ].split ("/" , 1 )[0 ].rsplit ("." , 1 )[0 ]
263282 trimmed = {n [len (beginning ) + 1 :] for n in names }
264283
265284 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