MCPcopy Create free account
hub / github.com/pybind/pybind11 / test_build_global_dist

Function test_build_global_dist

tests/extra_python_package/test_files.py:213–247  ·  view source on GitHub ↗
(monkeypatch, tmpdir)

Source from the content-addressed store, hash-verified

211
212
213def test_build_global_dist(monkeypatch, tmpdir):
214 monkeypatch.chdir(MAIN_DIR)
215 with build_global():
216 subprocess.run(
217 [
218 sys.executable,
219 "-m",
220 "build",
221 "--sdist",
222 "--outdir",
223 str(tmpdir),
224 *UV_ARGS,
225 ],
226 check=True,
227 )
228
229 (sdist,) = tmpdir.visit("*.tar.gz")
230 version = FILENAME_VERSION.search(sdist.basename).group(2)
231
232 with tarfile.open(str(sdist), "r:gz") as tar:
233 simpler = {n.split("/", 1)[-1] for n in tar.getnames()[1:]}
234 (pkg_info_path,) = (n for n in simpler if n.endswith("PKG-INFO"))
235
236 pyproject_toml = read_tz_file(tar, "pyproject.toml")
237 pkg_info = read_tz_file(tar, pkg_info_path).decode("utf-8")
238
239 files = headers | sdist_files
240 assert files <= simpler
241
242 assert b'name = "pybind11-global"' in pyproject_toml
243 assert f"Version: {version}" in pkg_info
244 assert "License-Expression: BSD-3-Clause" in pkg_info
245 assert "License-File: LICENSE" in pkg_info
246 assert "Provides-Extra: global" not in pkg_info
247 assert 'Requires-Dist: pybind11-global; extra == "global"' not in pkg_info
248
249
250def tests_build_wheel(monkeypatch, tmpdir):

Callers

nothing calls this directly

Calls 4

strClass · 0.85
read_tz_fileFunction · 0.85
build_globalFunction · 0.70
runMethod · 0.45

Tested by

no test coverage detected