def run(self):

        if self.force and os.path.isdir(self.build_dir):
            shutil.rmtree(self.build_dir)

        self.run_command('build_py')
        self._copy_package_data()
        self._copy_data_files()

        if self.debug_client is not None:
            try:
                shutil.copy(self.debug_client, os.path.join(self.build_dir, 'bin', '_pydebug.egg'))
                debug_conf = os.path.join(project_dir, 'package', 'bin', '_pydebug.conf')
                if os.path.exists(debug_conf):
                    shutil.copy(debug_conf, os.path.join(self.build_dir, 'bin', '_pydebug.conf'))
            except __HOLE__ as error:
                print('Could not copy {}: {}'.format(error.filename, error.strerror))

        install_packages(self.build_dir, self.distribution)

        # Link to the selected commands.conf as determined by self.scp_version (TODO: make this an install step)

        commands_conf = os.path.join(self.build_dir, 'default', 'commands.conf')
        source = os.path.join(self.build_dir, 'default', 'commands-scpv{}.conf'.format(self.scp_version))

        if os.path.isfile(commands_conf) or os.path.islink(commands_conf):
            os.remove(commands_conf)
        elif os.path.exists(commands_conf):
            message = 'Cannot create a link at "{}" because a file by that name already exists.'.format(commands_conf)
            raise SystemError(message)

        shutil.copy(source, commands_conf)
        self._make_archive()
        return
dataset/ETHPy150Open splunk/splunk-sdk-python/examples/searchcommands_app/setup.py/BuildCommand.run