def _should_run_cmake(commands, cmake_with_sdist):
    """Return True if at least one command requiring ``cmake`` to run
    is found in ``commands``."""
    for expected_command in ['build', 'build_ext', 'develop', 'install',
        'install_lib', 'bdist', 'bdist_dumb', 'bdist_egg', 'bdist_rpm',
        'bdist_wininst', 'bdist_wheel', 'test']:
        if expected_command in commands:
            return True
    if 'sdist' in commands and cmake_with_sdist:
        return True
    return False
