Example #1
0
File: setup.py Project: xbsd/pyq
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     soabi = get_config_var('SOABI')
     if soabi and os.uname()[0] == 'Darwin':
         filename = "%s.%s%s" % (filename[:-len(so_ext)], soabi, so_ext)
     return filename
Example #2
0
 def __init__(self, dist):
     install_lib.__init__(self, dist)
     # Append whichever platform specific extension to the jsbsim module
     # name
     build_ext = self.get_finalized_command('build_ext')
     self.module_name = build_ext.get_ext_filename(
         build_ext.extensions[0].name)
Example #3
0
File: setup.py Project: zjc5415/pyq
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     soabi = get_config_var('SOABI')
     if sys.version_info < (3, 5) and soabi and platform == 'Darwin':
         filename = "%s.%s%s" % (filename[:-len(so_ext)], soabi, so_ext)
     return filename
Example #4
0
    def run(self):
        # do the normal cleanup
        clean.run(self)

        # try to remove '_composite.{so,pyd,...}' extension,
        # regardless of the current system's extension name convention
        build_ext = self.get_finalized_command('build_ext')
        ext_fname = build_ext.get_ext_filename('overviewer_core.c_overviewer')
        versionpath = os.path.join("overviewer_core", "overviewer_version.py")
        primspath = os.path.join("overviewer_core", "src", "primitives.h")

        for fname in [ext_fname, primspath]:
            if os.path.exists(fname):
                try:
                    log.info("removing '%s'", fname)
                    if not self.dry_run:
                        os.remove(fname)

                except OSError:
                    log.warn("'%s' could not be cleaned -- permission denied",
                             fname)
            else:
                log.debug("'%s' does not exist -- can't clean it", fname)

        # now try to purge all *.pyc files
        for root, dirs, files in os.walk(
                os.path.join(os.path.dirname(__file__), ".")):
            for f in files:
                if f.endswith(".pyc"):
                    if self.dry_run:
                        log.warn("Would remove %s", os.path.join(root, f))
                    else:
                        os.remove(os.path.join(root, f))
Example #5
0
File: setup.py Project: e42s/pyq
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     soabi = get_config_var('SOABI')
     if soabi and os.uname()[0] == 'Darwin':
         filename = "%s.%s%s" % (filename[:-len(so_ext)], soabi, so_ext)
     return filename
Example #6
0
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     soabi = get_config_var('SOABI')
     if sys.version_info < (3, 5) and soabi and platform == 'Darwin':
         filename = "%s.%s%s" % (filename[:-len(so_ext)], soabi, so_ext)
     return filename
Example #7
0
    def run(self):
        # do the normal cleanup
        clean.run(self)

        # try to remove '_composite.{so,pyd,...}' extension,
        # regardless of the current system's extension name convention
        build_ext = self.get_finalized_command('build_ext')
        ext_fname = build_ext.get_ext_filename('overviewer_core.c_overviewer')
        versionpath = os.path.join("overviewer_core", "overviewer_version.py")
        primspath = os.path.join("overviewer_core", "src", "primitives.h")

        for fname in [ext_fname, primspath]:
            if os.path.exists(fname):
                try:
                    log.info("removing '%s'", fname)
                    if not self.dry_run:
                        os.remove(fname)

                except OSError:
                    log.warn("'%s' could not be cleaned -- permission denied",
                             fname)
            else:
                log.debug("'%s' does not exist -- can't clean it",
                          fname)

        # now try to purge all *.pyc files
        for root, dirs, files in os.walk(os.path.join(os.path.dirname(__file__), ".")):
            for f in files:
                if f.endswith(".pyc"):
                    if self.dry_run:
                        log.warn("Would remove %s", os.path.join(root,f))
                    else:
                        os.remove(os.path.join(root, f))
Example #8
0
    def get_ext_filename(self, fullname):
        """Convert the name of an extension (eg. "foo.bar") into the name
        of the file from which it will be loaded (eg. "foo/bar.so", or
        "foo\bar.pyd").
        """
        from distutils.command.build_ext import build_ext as _du_build_ext

        return _du_build_ext.get_ext_filename(self, fullname)
Example #9
0
 def test_get_ext_filename(self):
     # setuptools needs to give back the same
     # result than distutils, even if the fullname
     # is not in ext_map
     dist = Distribution()
     cmd = build_ext(dist)
     cmd.ext_map['foo/bar'] = ''
     res = cmd.get_ext_filename('foo')
     wanted = distutils_build_ext.get_ext_filename(cmd, 'foo')
     assert res == wanted
Example #10
0
 def get_ext_filename(self, ext_name):
     # since python3.5, python extensions' shared libraries use a suffix that corresponds to the value
     # of sysconfig.get_config_var('EXT_SUFFIX') and contains info about the architecture the library targets.
     # E.g. on x64 linux the suffix is ".cpython-XYZ-x86_64-linux-gnu.so"
     # When crosscompiling python wheels, we need to be able to override this suffix
     # so that the resulting file name matches the target architecture and we end up with a well-formed
     # wheel.
     filename = _build_ext.get_ext_filename(self, ext_name)
     orig_ext_suffix = sysconfig.get_config_var("EXT_SUFFIX")
     new_ext_suffix = os.getenv("PROTOCOL_BUFFERS_OVERRIDE_EXT_SUFFIX")
     if new_ext_suffix and filename.endswith(orig_ext_suffix):
         filename = filename[:-len(orig_ext_suffix)] + new_ext_suffix
     return filename
Example #11
0
    def run(self):
        # do the normal cleanup
        clean.run(self)

        # try to remove 'OIL.{so,pyd,...}' extension,
        # regardless of the current system's extension name convention
        build_ext = self.get_finalized_command("build_ext")
        fname = build_ext.get_ext_filename("OIL")
        if os.path.exists(fname):
            try:
                log.info("removing '%s'", fname)
                if not self.dry_run:
                    os.remove(fname)

            except OSError:
                log.warn("'%s' could not be cleaned -- permission denied", fname)
        else:
            log.debug("'%s' does not exist -- can't clean it", fname)
Example #12
0
    def run(self):
        # do the normal cleanup
        clean.run(self)

        # try to remove 'OIL.{so,pyd,...}' extension,
        # regardless of the current system's extension name convention
        build_ext = self.get_finalized_command('build_ext')
        fname = build_ext.get_ext_filename('OIL')
        if os.path.exists(fname):
            try:
                log.info("removing '%s'", fname)
                if not self.dry_run:
                    os.remove(fname)
                    
            except OSError:
                log.warn("'%s' could not be cleaned -- permission denied",
                         fname)
        else:
            log.debug("'%s' does not exist -- can't clean it",
                      fname)
Example #13
0
 def get_ext_filename(self, ext_name):
     return path_splitext(build_ext.get_ext_filename(self, ext_name))[0]
Example #14
0
File: setup.py Project: zjc5415/pyq
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     kxver = self.distribution.kxver
     return filename[:-len(so_ext)] + kxver.split('.')[0] + so_ext
Example #15
0
File: setup.py Project: xbsd/pyq
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     kxver = self.distribution.kxver
     return filename[:-len(so_ext)] + kxver.split('.')[0] + so_ext
Example #16
0
 def get_ext_filename(self, ext_name):
     if self._ctypes:
         return ext_name.split('.')[-1] + '.so'
     return build_ext.get_ext_filename(self, ext_name)
Example #17
0
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     kxver = self.distribution.kxver
     return filename[:-len(so_ext)] + kxver.replace('.', '_') + so_ext
Example #18
0
File: cross.py Project: eraldop/ae
 def get_ext_filename(self, ext_name):
     return build_ext.get_ext_filename(self, ext_name).replace(".so",".pyd")
Example #19
0
 def get_ext_filename(self, ext_name):
     return path_splitext(build_ext.get_ext_filename(self, ext_name))[0]
Example #20
0
 def get_ext_filename(self, ext_name):
     if self._ctypes:
         return ext_name.split(".")[-1] + ".so"
     return build_ext.get_ext_filename(self, ext_name)
Example #21
0
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     kxver = self.distribution.kxver
     return filename[:-len(so_ext)] + kxver.replace('.', '_') + so_ext
Example #22
0
 def get_ext_filename(self, ext_name):
     return build_ext.get_ext_filename(self,
                                       ext_name).replace(".so", ".pyd")
Example #23
0
 def get_ext_filename(self, ext_name):
     filename = _build_ext.get_ext_filename(self, ext_name)
     so_ext = get_config_var('SO')
     return filename[:-len(so_ext)] + so_ext