@property<EOL><INDENT>def build_ext(self):<DEDENT>
try:<EOL><INDENT>from setuptools.command.build_ext import build_ext<EOL><DEDENT>except ImportError:<EOL><INDENT>from distutils.command.build_ext import build_ext<EOL><DEDENT>buildcfg = self<EOL>class custom_build_ext(build_ext):<EOL><INDENT>def run(self):<EOL><INDENT>if buildcfg.use_pkgconfig:<EOL><INDENT>detected = buildcfg.detect_from_pkgconfig()<EOL><DEDENT>else:<EOL><INDENT>detected = False<EOL><DEDENT>if os.path.exists("<STR_LIT>"):<EOL><INDENT>buildcfg.use_built_igraph()<EOL>detected = True<EOL><DEDENT>if not detected:<EOL><INDENT>if buildcfg.download_igraph_if_needed and is_unix_like():<EOL><INDENT>detected = buildcfg.download_and_compile_igraph()<EOL>if detected:<EOL><INDENT>buildcfg.use_built_igraph()<EOL><DEDENT><DEDENT><DEDENT>if not detected:<EOL><INDENT>buildcfg.use_educated_guess()<EOL><DEDENT>if buildcfg.static_extension:<EOL><INDENT>buildcfg.replace_static_libraries(exclusions=["<STR_LIT:m>"])<EOL><DEDENT>buildcfg.print_build_info()<EOL>ext = first(extension for extension in self.extensions<EOL>if extension.name == "<STR_LIT>")<EOL>buildcfg.configure(ext)<EOL>build_ext.run(self)<EOL><DEDENT><DEDENT>return custom_build_ext<EOL>
Returns a class that can be used as a replacement for the
        ``build_ext`` command in ``distutils`` and that will download and
        compile the C core of igraph if needed.