Python distutils.command.build_ext.build_ext.run() Examples

The following are 30 code examples of distutils.command.build_ext.build_ext.run(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module distutils.command.build_ext.build_ext , or try the search function .
Example #1
Source File: setup.py    From YOLO3-4-Py with Apache License 2.0 6 votes vote down vote up
def run(self):
        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)),"__libdarknet","libdarknet.so")):
            logging.info("removing __libdarknet/libdarknet.so")
            os.remove(os.path.join(os.path.dirname(__file__),"__libdarknet","libdarknet.so"))

        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)), "libdarknet.so")):
            logging.info("removing libdarknet.so")
            os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),"libdarknet.so"))

        if os.path.exists(os.path.join(os.path.dirname(os.path.abspath(__file__)),"pydarknet.cpp")):
            logging.info("removing pydarknet.cpp")
            os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),"pydarknet.cpp"))

        for f in os.listdir(os.path.dirname(os.path.abspath(__file__))):
            if f.startswith("pydarknet.") and f.endswith(".so"):
                logging.info("removing " + f)
                os.remove(os.path.join(os.path.dirname(os.path.abspath(__file__)),f))

        clean.run(self) 
Example #2
Source File: setup.py    From poetry with MIT License 6 votes vote down vote up
def run(self):
        optional = True
        disabled = True
        for ext in self.extensions:
            with_ext = self.distribution.ext_status(ext)
            if with_ext is None:
                disabled = False
            elif with_ext:
                optional = False
                disabled = False
                break
        if disabled:
            return
        try:
            _build_ext.run(self)
        except DistutilsPlatformError:
            exc = sys.exc_info()[1]
            if optional:
                log.warn(str(exc))
                log.warn("skipping build_ext")
            else:
                raise 
Example #3
Source File: setup.py    From secp256k1-py with MIT License 6 votes vote down vote up
def run(self):
        if self.distribution.has_c_libraries():
            build_clib = self.get_finalized_command("build_clib")
            self.include_dirs.append(
                os.path.join(build_clib.build_clib, "include"),
            )
            self.include_dirs.extend(build_clib.build_flags['include_dirs'])

            self.library_dirs.append(
                os.path.join(build_clib.build_clib, "lib"),
            )
            self.library_dirs.extend(build_clib.build_flags['library_dirs'])

            self.define = build_clib.build_flags['define']

        return _build_ext.run(self) 
Example #4
Source File: setup.py    From pybtc with GNU General Public License v3.0 6 votes vote down vote up
def run(self):
        if self.distribution.has_c_libraries():
            build_clib = self.get_finalized_command("build_clib")
            self.include_dirs.append(
                os.path.join(build_clib.build_clib, "include"),
            )
            self.include_dirs.extend(build_clib.build_flags['include_dirs'])

            self.library_dirs.append(
                os.path.join(build_clib.build_clib, "lib"),
            )
            self.library_dirs.extend(build_clib.build_flags['library_dirs'])

            self.define = build_clib.build_flags['define']

        return _build_ext.run(self) 
Example #5
Source File: setup.py    From piqueserver with GNU General Public License v3.0 6 votes vote down vote up
def run(self):

        from Cython.Build import cythonize

        if USE_ASAN:
            from Cython.Compiler import Options
            # make asan/valgrind's memory leak results better
            Options.generate_cleanup_code = True

        compiler_directives = {'language_level': 3, 'embedsignature': True}
        if linetrace:
            compiler_directives['linetrace'] = True

        self.extensions = cythonize(self.extensions, compiler_directives=compiler_directives)

        _build_ext.run(self)

        run_setup(os.path.join(os.getcwd(), "setup.py"),
                  ['build_py'] + extra_args) 
Example #6
Source File: setup.py    From sqlalchemy with MIT License 5 votes vote down vote up
def run_tests(self):
        sys.stderr.write(
            "%s%spython setup.py test is deprecated by pypa.  Please invoke "
            "'tox' with no arguments for a basic test run.\n%s"
            % (self.COLOR_SEQ % self.RED, self.BOLD_SEQ, self.RESET_SEQ)
        )
        sys.exit(1) 
Example #7
Source File: setup.py    From secp256k1-py with MIT License 5 votes vote down vote up
def run(self):
        # Ensure library has been downloaded (sdist might have been skipped)
        download_library(self)

        _egg_info.run(self) 
Example #8
Source File: setup.py    From secp256k1-py with MIT License 5 votes vote down vote up
def run(self):
        download_library(self)
        _sdist.run(self) 
Example #9
Source File: setup.py    From secp256k1-py with MIT License 5 votes vote down vote up
def run(self):
            download_library(self)
            _bdist_wheel.run(self) 
Example #10
Source File: setup.py    From secp256k1-py with MIT License 5 votes vote down vote up
def run(self):
        if not has_system_lib():
            raise DistutilsError(
                "This library is not usable in 'develop' mode when using the "
                "bundled libsecp256k1. See README for details.")
        _develop.run(self) 
Example #11
Source File: setup.py    From sqlalchemy with MIT License 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            raise BuildFailed() 
Example #12
Source File: setup.py    From YOLO3-4-Py with Apache License 2.0 5 votes vote down vote up
def run(self):
        # This is triggered when src distribution is made. Not triggered for build_ext.
        setup_darknet()
        build.run(self) 
Example #13
Source File: setup.py    From backpack with MIT License 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            raise BuildExtFailed() 
Example #14
Source File: setup.py    From giraffez with Apache License 2.0 5 votes vote down vote up
def run(self):
        # Disabling parallel build for now. It causes issues on multiple
        # platforms with concurrent file access causing odd build errors
        #self.parallel = multiprocessing.cpu_count()
        build_ext.run(self) 
Example #15
Source File: setup.py    From llvmlite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        build_ext.run(self)
        build_library_files(self.dry_run)
        # HACK: this makes sure the library file (which is large) is only
        # included in binary builds, not source builds.
        from llvmlite.utils import get_library_files
        self.distribution.package_data = {
            "llvmlite.binding": get_library_files(),
        } 
Example #16
Source File: setup.py    From llvmlite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        from llvmlite.utils import get_library_files
        self.distribution.package_data = {
            "llvmlite.binding": get_library_files(),
        }
        install.run(self) 
Example #17
Source File: setup.py    From llvmlite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
        clean.run(self)
        path = os.path.join(here_dir, 'llvmlite.egg-info')
        if os.path.isdir(path):
            remove_tree(path, dry_run=self.dry_run)
        if not self.dry_run:
            self._rm_walk() 
Example #18
Source File: setup.py    From llvmlite with BSD 2-Clause "Simplified" License 5 votes vote down vote up
def run(self):
            # Ensure the binding file exist when running wheel build
            from llvmlite.utils import get_library_files
            # Turn on -fPIC for wheel building on Linux
            pic = sys.platform.startswith('linux')
            build_library_files(self.dry_run, pic=pic)
            self.distribution.package_data.update({
                "llvmlite.binding": get_library_files(),
            })
            # Run wheel build command
            bdist_wheel.run(self) 
Example #19
Source File: setup.py    From YOLO3-4-Py with Apache License 2.0 5 votes vote down vote up
def run(self):
        setup_darknet()
        build_ext.run(self)

        if not "DARKNET_HOME" in os.environ:
            clean_darknet(temp_dir) 
Example #20
Source File: setup.py    From aiochclient with MIT License 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except (DistutilsPlatformError, FileNotFoundError):
            raise BuildFailed() 
Example #21
Source File: setup.py    From aiokafka with Apache License 2.0 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except (DistutilsPlatformError, FileNotFoundError):
            raise BuildFailed() 
Example #22
Source File: setup.py    From apm-agent-python with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            raise BuildExtFailed() 
Example #23
Source File: build.py    From pendulum with MIT License 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except (DistutilsPlatformError, FileNotFoundError):
            print("************************************************************")
            print("Cannot compile C accelerator module, use pure python version")
            print("************************************************************") 
Example #24
Source File: recipe-579016.py    From code with MIT License 5 votes vote down vote up
def munge_command(inputvar, srcext, objextname, cmd):
    cmd = shlex.split(cmd.strip())
    munged = []
    # The first thing on the line will be the compiler itself; throw
    # that out.  Find dummy.srcext and dummy.objext, and substitute
    # appropriate Makefile variable names. Also, determine what objext
    # actually is.
    dummy_srcext = "dummy." + srcext
    objext = None
    for arg in cmd[1:]:
        if arg == dummy_srcext:
            munged.append(inputvar) # either $< or $^, depending
        elif arg.startswith("dummy."):
            munged.append("$@")
            objext = arg[len("dummy."):]
        else:
            if shellquote(arg) != arg:
                raise SystemExit("error: command {!r}: "
                                 "cannot put {!r} into a makefile"
                                 .format(cmd, arg))
            munged.append(arg)

    if not objext:
        raise SystemExit("error: command {!r}: failed to determine {}"
                         .format(cmd, objextname))

    return " ".join(munged), objext

# The easiest way to ensure that we use a properly configured compiler
# is to subclass build_ext, because some of the work for that is only
# done when build_ext.run() is called, grumble. 
Example #25
Source File: setup.py    From symengine.py with MIT License 5 votes vote down vote up
def run(self):
        # can't use super() here because _install is an old style class in 2.7
        _install.run(self)
        self.cmake_install() 
Example #26
Source File: setup.py    From symengine.py with MIT License 5 votes vote down vote up
def run(self):
        self.cmake_build()
        # can't use super() here because
        #  _build_ext is an old style class in 2.7
        _build_ext.run(self) 
Example #27
Source File: setup.py    From influxgraph with Apache License 2.0 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            raise BuildFailed() 
Example #28
Source File: setup.py    From ms_deisotope with Apache License 2.0 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except DistutilsPlatformError:
            traceback.print_exc()
            raise BuildFailed() 
Example #29
Source File: setup.py    From aiokafka with Apache License 2.0 5 votes vote down vote up
def run(self):
        try:
            build_ext.run(self)
        except (DistutilsPlatformError, FileNotFoundError):
            raise BuildFailed() 
Example #30
Source File: setup.py    From poetry with MIT License 5 votes vote down vote up
def run(self):
        build_cmd = self.get_finalized_command("build")
        build_cmd.run()
        sys.path.insert(0, build_cmd.build_lib)
        if sys.version_info[0] < 3:
            sys.path.insert(0, "tests/lib")
        else:
            sys.path.insert(0, "tests/lib3")
        import test_all

        if not test_all.main([]):
            raise DistutilsError("Tests failed")