def build_wheel(source_dir, wheel_dir, config_settings=None):
if config_settings is None:<EOL><INDENT>config_settings = {}<EOL><DEDENT>requires, backend = _load_pyproject(source_dir)<EOL>hooks = Pep517HookCaller(source_dir, backend)<EOL>with BuildEnvironment() as env:<EOL><INDENT>env.pip_install(requires)<EOL>reqs = hooks.get_requires_for_build_wheel(config_settings)<EOL>env.pip_install(reqs)<EOL>return hooks.build_wheel(wheel_dir, config_settings)<EOL><DEDENT>
Build a wheel from a source directory using PEP 517 hooks.

    :param str source_dir: Source directory containing pyproject.toml
    :param str wheel_dir: Target directory to create wheel in
    :param dict config_settings: Options to pass to build backend

    This is a blocking function which will run pip in a subprocess to install
    build requirements.