Example #1
0
    def finalize_options(self):

        build_ext.finalize_options(self)

        if self.compiler is None:
            compiler = get_default_compiler()
        else:
            compiler = self.compiler

        if compiler == "msvc":
            # Add msvc specific hacks

            if (sys.version_info.major, sys.version_info.minor) < (3, 3):
                # The check above is a nasty hack. We're using the python
                # version as a proxy for the MSVC version. 2008 doesn't
                # have stdint.h, so is needed. 2010 does.
                #
                # We need to add the path to msvc includes
                include_dirs.append(os.path.join(os.getcwd(), "include", "msvc_2008"))

            # We need to prepend lib to all the library names
            _libraries = []
            for each_lib in self.libraries:
                _libraries.append("lib" + each_lib)

            self.libraries = _libraries
Example #2
0
    def finalize_options(self):
        self.set_undefined_options('build')
        try:
            r_home = subprocess.check_output(("R", "RHOME"),
                                             universal_newlines=True)
        except:
            raise SystemExit("Error: Tried to guess R's HOME but no R command in the PATH.")

        r_home = r_home.split(os.linesep)
        #Twist if 'R RHOME' spits out a warning
        if r_home[0].startswith("WARNING"):
            r_home = r_home[1].rstrip()
        else:
            r_home = r_home[0].rstrip()

        rexec = RExec(r_home)
        if rexec.version[0] == 'development' or \
           cmp_version(rexec.version[:2], [2, 8]) == -1:
            if self.ignore_check_rversion:
                warnings.warn("R did not seem to have the minimum required version number")
            else:
                raise SystemExit("Error: R >= 2.8 required (and R told '%s')." %'.'.join(rexec.version))    

        try:
            super(build_ext, self).finalize_options() 
        except TypeError:
            # distutils parent class an old style Python class
            _build_ext.finalize_options(self)
Example #3
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     import builtins
     # Prevent numpy from thinking it is still in its setup process:
     builtins.__NUMPY_SETUP__ = False
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #4
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process
     __builtins__.__NUMPY_SETUP__ = False
     print('build_ext: including numpy files')
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #5
0
 def finalize_options(self):
     from Cython.Build import cythonize
     self.distribution.ext_modules[:] = cythonize(
         self.distribution.ext_modules,
         compiler_directives={'embedsignature': True},
     )
     _build_ext.finalize_options(self)
Example #6
0
File: setup.py Project: jopohl/urh
 def finalize_options(self):
     print("Finalizing options")
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process:
     __builtins__.__NUMPY_SETUP__ = False
     import numpy
     self.include_dirs.append(numpy.get_include())
    def finalize_options(self):
        options_pairs = []
        if not self.with_mysql_capi:
            options_pairs.append(('with_mysql_capi', 'with_mysql_capi'))
        if not self.with_protobuf_include_dir:
            options_pairs.append(('with_protobuf_include_dir',
                                  'with_protobuf_include_dir'))
        if not self.with_protobuf_lib_dir:
            options_pairs.append(('with_protobuf_lib_dir',
                                  'with_protobuf_lib_dir'))
        if not self.with_protoc:
            options_pairs.append(('with_protoc', 'with_protoc'))
        if options_pairs:
            self.set_undefined_options('install', *options_pairs)

        build_ext.finalize_options(self)

        print("# Python architecture: {0}".format(py_arch))
        print("# Python ARCH_64BIT: {0}".format(ARCH_64BIT))

        self.connc_lib = os.path.join(self.build_temp, 'connc', 'lib')
        self.connc_include = os.path.join(self.build_temp, 'connc', 'include')
        self.protobuf_lib = os.path.join(self.build_temp, 'protobuf', 'lib')
        self.protobuf_include = os.path.join(self.build_temp, 'protobuf', 'include')

        if self.with_mysql_capi:
            self._finalize_connector_c(self.with_mysql_capi)

        if not self.with_protobuf_include_dir:
            self.with_protobuf_include_dir = \
                os.environ.get("MYSQLXPB_PROTOBUF_INCLUDE_DIR")

        if not self.with_protobuf_lib_dir:
            self.with_protobuf_lib_dir = \
                os.environ.get("MYSQLXPB_PROTOBUF_LIB_DIR")

        if not self.with_protoc:
            self.with_protoc = os.environ.get("MYSQLXPB_PROTOC")

        if self.with_protobuf_include_dir:
            print("# Protobuf include directory: {0}"
                  "".format(self.with_protobuf_include_dir))
        else:
            log.error("Unable to find Protobuf include directory.")
            sys.exit(1)

        if self.with_protobuf_lib_dir:
            print("# Protobuf library directory: {0}"
                  "".format(self.with_protobuf_lib_dir))
        else:
            log.error("Unable to find Protobuf library directory.")
            sys.exit(1)

        if self.with_protoc:
            print("# Protobuf protoc binary: {0}".format(self.with_protoc))
        else:
            log.error("Unable to find Protobuf protoc binary.")
            sys.exit(1)

        self._finalize_protobuf()
    def finalize_options(self):
        self.set_undefined_options(
            'install',
            ('extra_compile_args', 'extra_compile_args'),
            ('with_mysql_capi', 'with_mysql_capi'),
            ('with_protobuf_include_dir', 'with_protobuf_include_dir'),
            ('with_protobuf_lib_dir', 'with_protobuf_lib_dir'),
            ('with_protoc', 'with_protoc'))

        build_ext.finalize_options(self)

        print("# Python architecture: {0}".format(py_arch))
        print("# Python ARCH_64BIT: {0}".format(ARCH_64BIT))

        if self.with_mysql_capi:
            self._finalize_connector_c(self.with_mysql_capi)

        if not self.with_protobuf_include_dir:
            self.with_protobuf_include_dir = \
                os.environ.get("MYSQLXPB_PROTOBUF_INCLUDE_DIR")

        if not self.with_protobuf_lib_dir:
            self.with_protobuf_lib_dir = \
                os.environ.get("MYSQLXPB_PROTOBUF_LIB_DIR")

        if not self.with_protoc:
            self.with_protoc = os.environ.get("MYSQLXPB_PROTOC")
Example #9
0
    def finalize_options(self):
        build_ext.finalize_options(self)

        if not self.distribution.has_c_libraries():
            return

        # Go through individual extensions and set their rpath variable and
        # library search paths

        build_clib = self.get_finalized_command("build_clib")
        libnames = [libname for libname, _ in build_clib.libraries]

        rpaths_abs = [os.path.dirname(build_clib.get_fullpath(lib))
                      for lib in build_clib.libraries]
        rpaths_abs = list(set(rpaths_abs))

        libdirs = [os.path.join(build_clib.build_clib, p)
                   for p in rpaths_abs]

        for ext in self.extensions:
            ext_path = self.get_ext_filename(ext.name)
            rpaths_rel = [os.path.relpath(p, os.path.dirname(ext_path))
                          for p in rpaths_abs]
            ext.runtime_library_dirs.extend(
                ["$ORIGIN/{}".format(p) for p in rpaths_rel])

            ext.libraries.extend(libnames)
            ext.library_dirs.extend(libdirs)
Example #10
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process:
     if hasattr(__builtins__, '__NUMPY_SETUP__'):
         __builtins__.__NUMPY_SETUP__ = False
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #11
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # prevent numpy from thinking it is still in its setup process
     __builtins__.__NUMPY_SETUP__ = False
     import numpy
     # place numpy includes first, see gh #156
     self.include_dirs.insert(0, numpy.get_include())
Example #12
0
    def finalize_options(self):
        _build_ext.finalize_options(self)

        self.set_undefined_options("build",
            ("force_pyx_compile", "force_pyx_compile"),
            ("force_template_update", "force_template_update")
        )
 def finalize_options(self):
     # Validate the --enable-openmp and --disable-openmp command line options:
     # the user should provide at most one of them.
     if self.enable_openmp and self.disable_openmp:
         raise _DistutilsOptionError("--enable-openmp and --disable-openmp are mutually exclusive")
     # Chain to method in parent class.
     _build_ext.finalize_options(self)
Example #14
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Before importing numpy, we need to make sure it doesn't think it
     # is still during its setup process:
     __builtins__.__NUMPY_SETUP__ = False
     import numpy
     # Add location of numpy headers:
     self.include_dirs.append(numpy.get_include())
    def finalize_options(self):
        self.set_undefined_options('install',
                                   ('with_mysql_capi', 'with_mysql_capi'))

        build_ext.finalize_options(self)

        if self.with_mysql_capi:
            self._finalize_connector_c(self.with_mysql_capi)
Example #16
0
    def finalize_options(self):

        build_ext.finalize_options(self)

        if self.compiler is None:
            compiler = get_default_compiler()
        else:
            compiler = self.compiler
Example #17
0
    def finalize_options(self):
        self.with_proj4 = self.truthify(self.with_proj4)
        self.with_geos = self.truthify(self.with_geos)
        self.with_geosadvanced = self.truthify(self.with_geosadvanced)
        self.with_iconv = self.truthify(self.with_iconv)
        self.with_freexl = self.truthify(self.with_freexl)

        build_ext.finalize_options(self)
Example #18
0
    def finalize_options(self):
        build_ext.finalize_options(self)
        if self.compiler is None:
            compiler = get_default_compiler()
        else:
            compiler = self.compiler

        if compiler == 'msvc':
            include_dirs.append('compat/win32')
Example #19
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process
     try:
         del builtins.__NUMPY_SETUP__
     except AttributeError:
         pass
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #20
0
 def finalize_options(self):
   # check if the "BOB_BUILD_DIRECTORY" environment variable is set
   env = os.environ
   if 'BOB_BUILD_DIRECTORY' in env and env['BOB_BUILD_DIRECTORY']:
     # HACKISH: check if we are currently developed by inspecting the way we got called
     if 'develop' in sys.argv:
       self.build_temp = os.path.join(env['BOB_BUILD_DIRECTORY'], 'build_temp')
       self.build_lib = os.path.join(env['BOB_BUILD_DIRECTORY'], 'build_lib')
   _build_ext.finalize_options(self)
Example #21
0
 def finalize_options(self):
     # Setting include_dirs, library_dirs, swig_opts here instead of in Extension constructor allows them to be
     # overridden using -I and -L command line options to python setup.py build_ext.
     build_ext.finalize_options(self)
     include_dirs, library_dirs = locate_ob()
     self.include_dirs.append(include_dirs)
     self.library_dirs.append(library_dirs)
     self.swig_opts = ['-c++', '-small', '-O', '-templatereduce', '-naturalvar']
     self.swig_opts += ['-I%s' % i for i in self.include_dirs]
     print('- include_dirs: %s\n- library_dirs: %s' % (self.include_dirs, self.library_dirs))
Example #22
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process:
     import builtins
     if hasattr(builtins, '__NUMPY_SETUP__'):
         del builtins.__NUMPY_SETUP__
     import importlib
     import numpy
     importlib.reload(numpy)
     self.include_dirs.append(numpy.get_include())
Example #23
0
 def finalize_options(self):
     global do_output
     build_ext.finalize_options(self)
     # I couldn't find an easy way to send the user option from my_install to my_buld_ext.
     # So use a global variable. (UGH!)
     if self.njobs is None and 'glob_njobs' in globals():
         global glob_njobs
         self.njobs = glob_njobs
     add_dirs(self, output=do_output)
     do_output = False
Example #24
0
 def finalize_options(self):
     if sys.version_info[0] >= 3:
         import builtins
     else:
         import __builtin__ as builtins
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process:
     builtins.__NUMPY_SETUP__ = False
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #25
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # __builtins__ is a dict when this module isn't __main__
     # see https://docs.python.org/2/reference/executionmodel.html
     if isinstance(__builtins__, dict):
         __builtins__['__NUMPY_SETUP__'] = False
     else:
         __builtins__.__NUMPY_SETUP__ = False
     import numpy as np
     self.include_dirs.append(np.get_include())
    def finalize_options(self):
        if not self.with_mysql_capi:
            self.set_undefined_options('install',
                                       ('with_mysql_capi', 'with_mysql_capi'))

        build_ext.finalize_options(self)
        self.connc_lib = os.path.join(self.build_temp, 'connc', 'lib')
        self.connc_include = os.path.join(self.build_temp, 'connc', 'include')

        if self.with_mysql_capi:
            self._finalize_connector_c(self.with_mysql_capi)
Example #27
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     if self.compiler is None:
         # we use this variable with tox to build using GCC on Windows.
         # https://bitbucket.org/hpk42/tox/issues/274/specify-compiler
         self.compiler = os.environ.get("DISTUTILS_COMPILER", None)
     if self.compiler == "mingw32":
         # workaround for virtualenv changing order of libary_dirs on
         # Windows, which makes gcc fail to link with the correct libpython
         # https://github.com/mingwpy/mingwpy.github.io/issues/31
         self.library_dirs.insert(0, os.path.join(sys.exec_prefix, 'libs'))
Example #28
0
    def finalize_options(self):
        '''
        In order to avoid premature import of numpy before it gets installed as a dependency
        get numpy include directories during the extensions building process
	http://stackoverflow.com/questions/19919905/how-to-bootstrap-numpy-installation-in-setup-py
        '''
        build_ext.finalize_options(self)
        # Prevent numpy from thinking it is still in its setup process:
        __builtins__.__NUMPY_SETUP__ = False
        import numpy
        self.include_dirs.append(numpy.get_include())
Example #29
0
 def finalize_options(self):
     # Setting include_dirs, library_dirs, swig_opts here instead of in Extension constructor allows them to be
     # overridden using -I and -L command line options to python setup.py build_ext.
     if not self.include_dirs and not self.library_dirs:
         self.include_dirs, self.library_dirs = locate_ob()
     else:
         print('Open Babel location manually specified:')
     print('- include_dirs: %s\n- library_dirs: %s' % (self.include_dirs, self.library_dirs))
     build_ext.finalize_options(self)
     self.swig_opts = ['-c++', '-small', '-O', '-templatereduce', '-naturalvar']
     self.swig_opts += ['-I%s' % i for i in self.include_dirs]
Example #30
0
    def finalize_options(self):
            build_ext.finalize_options(self)
            # Prevent numpy from thinking it is still in its setup process:
            # https://docs.python.org/2/library/__builtin__.html#module-__builtin__
            if isinstance(__builtins__, dict):
                __builtins__["__NUMPY_SETUP__"] = False
            else:
                __builtins__.__NUMPY_SETUP__ = False

            import numpy
            self.include_dirs.append(numpy.get_include())
Example #31
0
 def finalize_options(self):
     """Finalize this command's options."""
     build_ext.finalize_options(self)
     if self.gen_compiledb:
         self.dry_run = True  # pylint: disable=attribute-defined-outside-init
Example #32
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     if self.cmake_args is None:
         self.cmake_args = []
     else:
         self.cmake_args = shlex.split(self.cmake_args)
Example #33
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #34
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     if self.define is not None:
         self.define.extend(define_opts)
     elif define_opts:
         self.define = define_opts
Example #35
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Get the value of the skip-driver parameter from the install command.
     self.set_undefined_options("install", ("skip_driver", "skip_driver"))
     self.set_undefined_options("build", ("skip_driver", "skip_driver"))
Example #36
0
    def finalize_options(self):
        _build_ext.finalize_options(self)

        # Prevent numpy from thinking it's still in its setup process
        import numpy as np
        self.include_dirs.append(np.get_include())
Example #37
0
    def finalize_options(self):
        build_ext.finalize_options(self)

        # initialise #define list
        self.define = self.define or []

        # try to get commit from working directory
        flask_commit = run(['git', 'rev-parse', '--short', 'HEAD'],
                           stdout=PIPE, stderr=DEVNULL, universal_newlines=True
                           ).stdout.strip() or 'missing'

        # add commit definition
        self.define += [
            ('FLASKCOMMIT', f'"{flask_commit}"'),
        ]

        # process healpix_dir if given
        if self.healpix_dir is not None:
            print(f'HEALPix path: {self.healpix_dir}')

            # must be a directory
            if not os.path.isdir(self.healpix_dir):
                raise ValueError(f'not a directory: {self.healpix_dir}')

            # infer include directory if not given explicitly
            if self.healpix_include_dir is None:
                self.healpix_include_dir = os.path.join(self.healpix_dir, 'include', 'healpix_cxx')

            # infer lib directory if not given explicitly
            if self.healpix_lib_dir is None:
                self.healpix_lib_dir = os.path.join(self.healpix_dir, 'lib')

            # infer data directory if not given explicitly
            if self.healpix_data_dir is None:
                self.healpix_data_dir = os.path.join(self.healpix_dir, 'data')

        # process healpix_include_dir if given
        if self.healpix_include_dir is not None:
            print(f'HEALPix include path: {self.healpix_include_dir}')

            if not os.path.isdir(self.healpix_include_dir):
                raise ValueError(f'not a directory: {self.healpix_include_dir}')

            self.include_dirs.append(self.healpix_include_dir)

        # process healpix_lib_dir if given
        if self.healpix_lib_dir is not None:
            print(f'HEALPix lib path: {self.healpix_lib_dir}')

            if not os.path.isdir(self.healpix_lib_dir):
                raise ValueError(f'not a directory: {self.healpix_lib_dir}')

            self.library_dirs.append(self.healpix_lib_dir)
            self.rpath.append(self.healpix_lib_dir)

        # healpix_data_dir must be given
        if self.healpix_data_dir is None:
            raise ValueError('missing healpix_data_dir option')

        print(f'HEALPix data path: {self.healpix_data_dir}')

        if not os.path.isdir(self.healpix_data_dir):
            raise ValueError(f'not a directory: {self.healpix_data_dir}')

        # add definitions related to HEALPix
        self.define += [
            ('HEALPIX_DATA', f'"{self.healpix_data_dir}"'),
            ('USEXCOMPLEX', 0),
            ('USEMAP2TGA', 0),
        ]
Example #38
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     __builtins__.__NUMPY_SETUP__ = False
     import numpy  # pylint: disable=import-outside-toplevel
     self.include_dirs.append(numpy.get_include())
Example #39
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     builtins.__NUMPY_SETUP__ = False
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #40
0
 def finalize_options(self):
     # Setting parallel to true can break builds when we need to configure
     # embedded libraries, which we do by changing directories. If that
     # happens while we're compiling, we may not be able to find source code.
     build_ext.finalize_options(self)
Example #41
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     build_obj = self.distribution.get_command_obj("build")
     self.use_openmp = build_obj.use_openmp
     self.use_cython = build_obj.use_cython
     self.force_cython = build_obj.force_cython
Example #42
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process:
     __builtins__.__NUMPY_SETUP__ = False
Example #43
0
 def finalize_options(self):
     SetuptoolsBuildExtCmd.finalize_options(self)
Example #44
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     # See http://stackoverflow.com/a/21621689/2509873
     builtins.__NUMPY_SETUP__ = False
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #45
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     check_dependencies()
Example #46
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     is_windows = platform.system() == 'Windows'
     is_py2 = sys.version_info[0] < 3
     if self.compiler is None and is_windows and is_py2:
         self.compiler = 'mingw32'
Example #47
0
 def finalize_options(self):
     _build_ext.finalize_options(self)
     # Prevent numpy from thinking it is still in its setup process:
     __builtins__.__NUMPY_SETUP__ = False
     import numpy
     self.include_dirs.append(numpy.get_include())
Example #48
0
 def finalize_options(self):
     build_ext.finalize_options(self)
Example #49
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     self.set_undefined_options("build", ("download_dir", "download_dir"))
Example #50
0
 def finalize_options(self):
     """Post-process options."""
     print("build_ext.finalize_options")
     build_ext.finalize_options(self)
Example #51
0
 def finalize_options(self):
     build_ext.finalize_options(self)
     import numpy
     if not len(BLAS_DICT):
         self.look_for_blas()
     self.include_dirs.append(numpy.get_include())