def run(self): # Ensure that there is a basic library build for bdist_egg to pull from. self.run_command("build") # Clean out any libwx* symlinks in the build_lib folder, as they will # turn into copies in the egg since zip files can't handle symlinks. # The links are not really needed since the extensions link to # specific soname, and they could bloat the egg too much if they were # left in. # # TODO: can eggs have post-install scripts that would allow us to # restore the links? # build_lib = self.get_finalized_command('build').build_lib build_lib = opj(build_lib, 'wx') for libname in glob.glob(opj(build_lib, 'libwx*')): if os.path.islink(libname): if isDarwin: # On Mac the name used by the extension module is the real # file, so we can just get rid of all the links. os.unlink(libname) elif canGetSOName(): # On linux the soname used in the extension modules may # be (probably is) one of the symlinks, so we have to be # more tricky here. If the named file is a link and it is # the soname, then remove the link and rename the # linked-to file to this name. soname = getSOName(libname) if soname == os.path.basename(libname): realfile = os.path.join(build_lib, os.readlink(libname)) os.unlink(libname) os.rename(realfile, libname) else: os.unlink(libname) else: # Otherwise just leave the symlink there since we don't # know what to do with it. pass # Run the default bdist_egg command orig_bdist_egg.run(self)
def run(self): # Use build.py to perform the sdist cmd = [sys.executable, '-u', 'build.py', 'sdist'] cmd = ' '.join(cmd) runcmd(cmd) # Put the filename in dist_files in case the upload command is used. # On the other hand, PyPI's upload size limit is waaaaaaaaay too # small so it probably doesn't matter too much... sdist_file = opj(self.dist_dir, self.distribution.get_fullname()+'.tar.gz') self.distribution.dist_files.append(('sdist', '', sdist_file))
def run(self): # Use build.py to perform the sdist cmd = ['"{}"'.format(sys.executable), '-u', 'build.py', 'sdist'] cmd = ' '.join(cmd) runcmd(cmd) # Put the filename in dist_files in case the upload command is used. # On the other hand, PyPI's upload size limit is waaaaaaaaay too # small so it probably doesn't matter too much... sdist_file = opj(self.dist_dir, self.distribution.get_fullname()+'.tar.gz') self.distribution.dist_files.append(('sdist', '', sdist_file))