src/cmake_build_extension/build_ext_option.py
def add_new_build_ext_option(option: BuildExtOption, override: bool = True):
    """
    Workaround to add an existing option shown in python setup.py build_ext -h.

    Args:
        option: The new option to add.
        override: Delete the option if it already exists.
    """

    if override:
        build_ext.user_options = \
            [o for o in build_ext.user_options if o[1] is not option.short]
    else:
        for o in build_ext.user_options:
            if o[1] == option.short:
                raise ValueError(f"Short option '{o[1]}' already exists")

    build_ext.user_options.append(tuple(option))

    Workaround to add an existing option shown in python setup.py build_ext -h.

    Args:
        option: The new option to add.
        override: Delete the option if it already exists.
    
Workaround to add an existing option shown in python setup.py build_ext -h.
Workaround to add an existing option shown in python setup . py build_ext - h .
def add_new_build_ext_option(option: BuildExtOption, override: bool = True):
    if override:
        build_ext.user_options = \
            [o for o in build_ext.user_options if o[1] is not option.short]
    else:
        for o in build_ext.user_options:
            if o[1] == option.short:
                raise ValueError(f"Short option '{o[1]}' already exists")
    build_ext.user_options.append(tuple(option))
def add_new_build_ext_option ( option : BuildExtOption , override : bool = True ) : if override : build_ext . user_options = [ o for o in build_ext . user_options if o [ 1 ] is not option . short ] else : for o in build_ext . user_options : if o [ 1 ] == option . short : raise ValueError ( f"Short option '{o[1]}' already exists" ) build_ext . user_options . append ( tuple ( option ) )
Workaround to add an existing option shown in python setup.py build_ext -h.
Workaround to add an existing option shown in python setup . py build_ext - h .
"""
    Workaround to add an existing option shown in python setup.py build_ext -h.

    Args:
        option: The new option to add.
        override: Delete the option if it already exists.
    """
option
BuildExtOption
The new option to add.
The new option to add .
override
bool
Delete the option if it already exists.
Delete the option if it already exists .