WIP - initial punt at audit command

This commit is contained in:
Joe Rickerby
2026-02-04 09:26:35 +00:00
parent e8646fb903
commit 619e1dc989
7 changed files with 299 additions and 0 deletions
+43
View File
@@ -541,3 +541,46 @@ before-all = ["override2"]
options_reader.get("config-settings", option_format=ShlexTableFormat())
== "key1=value1 key2=override2 empty='' key3=value3"
)
def test_audit_option(tmp_path, platform):
pyproject_toml: Path = tmp_path / "pyproject.toml"
pyproject_toml.write_text(
"""
[tool.cibuildwheel]
audit = "abi3audit {abi3_wheel}"
"""
)
options_reader = OptionsReader(pyproject_toml, platform=platform, env={})
assert options_reader.get("audit", option_format=ListFormat(" && ")) == "abi3audit {abi3_wheel}"
def test_audit_option_list(tmp_path, platform):
pyproject_toml: Path = tmp_path / "pyproject.toml"
pyproject_toml.write_text(
"""
[tool.cibuildwheel]
audit = ["first command", "second command"]
"""
)
options_reader = OptionsReader(pyproject_toml, platform=platform, env={})
assert (
options_reader.get("audit", option_format=ListFormat(" && "))
== "first command && second command"
)
def test_audit_option_env(tmp_path, platform):
pyproject_toml: Path = tmp_path / "pyproject.toml"
pyproject_toml.write_text(
"""
[tool.cibuildwheel]
"""
)
options_reader = OptionsReader(
pyproject_toml, platform=platform, env={"CIBW_AUDIT": "my-audit-tool {wheel}"}
)
assert options_reader.get("audit", option_format=ListFormat(" && ")) == "my-audit-tool {wheel}"