def build_wheel(wheel_directory, config_settings=None, metadata_directory=None):
    """Stop building if wayland requested but pywlroots is not installed."""
    if wants_wayland(config_settings):
        try:
            import wlroots  # noqa: F401
        except ImportError:
            sys.exit("Wayland backend requested but pywlroots is not installed.")

    return _orig.build_wheel(wheel_directory, config_settings, metadata_directory)
Stop building if wayland requested but pywlroots is not installed.
builder.py