(monkeypatch, tmpdir)
| 211 | |
| 212 | |
| 213 | def 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 | |
| 250 | def tests_build_wheel(monkeypatch, tmpdir): |
nothing calls this directly
no test coverage detected