Python distutils.core.setup.cfg() Examples

The following are 4 code examples of distutils.core.setup.cfg(). 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.core.setup , or try the search function .
Example #1
Source File: setup.py    From pyq with Apache License 2.0 5 votes vote down vote up
def finalize_options(self):
        if self.q_home is None:
            self.q_home = get_q_home(os.environ)
        if self.q_arch is None:
            self.q_arch = get_q_arch(self.q_home)
        if self.q_version is None:
            self.q_version = get_q_version(self.q_home)
        if self.python_dll is None:
            self.python_dll = get_python_dll(sys.executable)
        if self.dest is None:
            self.dest = 'setup.cfg'
        if WINDOWS:
            self.extra_link_args = [r'src\pyq\kx\%s\q.lib' % self.q_arch] 
Example #2
Source File: setup.py    From magnitude with MIT License 5 votes vote down vote up
def __setattr__(self, k, v):
        # Make sure we don't link against the SQLite library, no matter what setup.cfg says
        if self.amalgamation and k == "libraries":
            v = None
        self.__dict__[k] = v 
Example #3
Source File: setup.py    From supersqlite with MIT License 5 votes vote down vote up
def __setattr__(self, k, v):
        # Make sure we don't link against the SQLite library, no matter what setup.cfg says
        if self.amalgamation and k == "libraries":
            v = None
        self.__dict__[k] = v 
Example #4
Source File: setup.py    From poetry with MIT License 4 votes vote down vote up
def check_extension_availability(self, ext):
        cache = os.path.join(self.build_temp, "check_%s.out" % ext.feature_name)
        if not self.force and os.path.isfile(cache):
            data = open(cache).read().strip()
            if data == "1":
                return True
            elif data == "0":
                return False
        mkpath(self.build_temp)
        src = os.path.join(self.build_temp, "check_%s.c" % ext.feature_name)
        open(src, "w").write(ext.feature_check)
        log.info("checking if %s is compilable" % ext.feature_name)
        try:
            [obj] = self.compiler.compile(
                [src],
                macros=ext.define_macros + [(undef,) for undef in ext.undef_macros],
                include_dirs=ext.include_dirs,
                extra_postargs=(ext.extra_compile_args or []),
                depends=ext.depends,
            )
        except CompileError:
            log.warn("")
            log.warn(
                "%s is not found or a compiler error: forcing --%s"
                % (ext.feature_name, ext.neg_option_name)
            )
            log.warn(
                "(if %s is installed correctly, you may need to" % ext.feature_name
            )
            log.warn(" specify the option --include-dirs or uncomment and")
            log.warn(" modify the parameter include_dirs in setup.cfg)")
            open(cache, "w").write("0\n")
            return False
        prog = "check_%s" % ext.feature_name
        log.info("checking if %s is linkable" % ext.feature_name)
        try:
            self.compiler.link_executable(
                [obj],
                prog,
                output_dir=self.build_temp,
                libraries=ext.libraries,
                library_dirs=ext.library_dirs,
                runtime_library_dirs=ext.runtime_library_dirs,
                extra_postargs=(ext.extra_link_args or []),
            )
        except LinkError:
            log.warn("")
            log.warn(
                "%s is not found or a linker error: forcing --%s"
                % (ext.feature_name, ext.neg_option_name)
            )
            log.warn(
                "(if %s is installed correctly, you may need to" % ext.feature_name
            )
            log.warn(" specify the option --library-dirs or uncomment and")
            log.warn(" modify the parameter library_dirs in setup.cfg)")
            open(cache, "w").write("0\n")
            return False
        open(cache, "w").write("1\n")
        return True