Files
cibuildwheel/test/test_meson_python.py
T
Joe RickerbyandHenry Schreiner a2f965f62f Add an integration test and debug issues with the meson backend (#2718)
* Add an integration test with the meson backend

* Modify script to allow testing of the GHA action on a PR

* Try adding cython to languages in meson config

* Revert "Try adding cython to languages in meson config"

This reverts commit 50378a1c7e38665492ad0c683b178e4d96928e1e.

* Pass --vsenv to meson on windows

As seen here https://github.com/matplotlib/matplotlib/blob/9957c394bd01deb7a9bd9cb27804f447a52dc522/.github/workflows/cibuildwheel.yml#L114

* Disable win32 builds for the meson test

* Move the windows-specific config into the test project definition

This is so it can be tested with bin/run_example_ci_configs.py

* Add some docs to the FAQ about meson on windows

* Update bin/run_example_ci_configs.py

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>

---------

Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
2026-02-08 10:36:47 +00:00

30 lines
1.0 KiB
Python

import packaging.utils
from . import test_projects, utils
meson_project = test_projects.new_meson_project()
def test_meson_python_basic(tmp_path, build_frontend_env):
"""Test that cibuildwheel can build a project with meson-python backend."""
project_dir = tmp_path / "project"
meson_project.generate(project_dir)
# build the wheels
actual_wheels = utils.cibuildwheel_run(
project_dir,
add_env=build_frontend_env,
single_python=True,
)
# check that the expected wheels are produced
# note that the meson test project doesn't support win32.
is_windows = utils.get_platform() == "windows"
expected_wheels = utils.expected_wheels(
"spam", "0.1.0", single_python=True, single_arch=is_windows
)
actual_wheels_normalized = {packaging.utils.parse_wheel_filename(w) for w in actual_wheels}
expected_wheels_normalized = {packaging.utils.parse_wheel_filename(w) for w in expected_wheels}
assert actual_wheels_normalized == expected_wheels_normalized