-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1588 from pypa/frontend-flags
Add the ability to pass extra flags to a build frontend through CIBW_BUILD_FRONTEND
- Loading branch information
Showing
10 changed files
with
190 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import subprocess | ||
|
||
import pytest | ||
|
||
from . import utils | ||
from .test_projects.c import new_c_project | ||
|
||
|
||
@pytest.mark.parametrize("frontend_name", ["pip", "build"]) | ||
def test_build_frontend_args(tmp_path, capfd, frontend_name): | ||
project = new_c_project() | ||
project_dir = tmp_path / "project" | ||
project.generate(project_dir) | ||
|
||
# the build will fail because the frontend is called with '-h' - it prints the help message | ||
with pytest.raises(subprocess.CalledProcessError): | ||
utils.cibuildwheel_run( | ||
project_dir, | ||
add_env={ | ||
"CIBW_BUILD": "cp311-*", | ||
"CIBW_BUILD_FRONTEND": f"{frontend_name}; args: -h", | ||
}, | ||
) | ||
|
||
captured = capfd.readouterr() | ||
print(captured.out) | ||
|
||
# check that the help message was printed | ||
if frontend_name == "pip": | ||
assert "Usage:" in captured.out | ||
assert "Wheel Options:" in captured.out | ||
else: | ||
assert "usage:" in captured.out | ||
assert "A simple, correct Python build frontend." in captured.out |
Oops, something went wrong.