<commit_before># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# BuildRPMDriver derived classes expose the following methods:
#
# build_package(). This method will perform the actual package build using
#                  the driver-specific approach.

from dlrn.drivers.buildrpm import BuildRPMDriver
import dlrn.shell

import io
import logging
import os
import re
import sh

from time import localtime
from time import strftime
from time import time

logging.basicConfig(level=logging.ERROR,
                    format='%(asctime)s %(levelname)s:%(name)s:%(message)s')
logger = logging.getLogger("dlrn-build-koji")
logger.setLevel(logging.INFO)

# FIXME(jpena): needs to be configurable, and driver-independent
mock_base_packages = "basesystem rpm-build python2-devel gcc make "\
                     "python-sqlalchemy python-webob ghostscript graphviz "\
                     "python-sphinx python-eventlet python-six python-pbr "\
                     "openstack-macros git yum-plugin-priorities rubygems"\
                     "python-setuptools_scm"


class KojiBuildDriver(BuildRPMDriver):
    DRIVER_CONFIG = {
        'kojibuild_driver': {
            'koji_krb_principal': {'name': 'krb_principal'},
            'koji_krb_keytab': {'name': 'krb_keytab'},
            'koji_scratch_build': {'name': 'scratch_build', 'type': 'boolean',
                                   'default': True},
            'koji_build_target': {'name': 'build_target'},
            'koji_arch': {'name': 'arch', 'default': 'x86_64'},
            'koji_use_rhpkg': {'name': 'use_rhpkg', 'type': 'boolean'},
            'koji_exe': {'default': 'koji'},
            'fetch_mock_config': {'type': 'boolean'},
        }
    }

    def __init__(self, *args, **kwargs):
        super(KojiBuildDriver, self).__init__(*args, **kwargs)
        self.exe_name = self.config_options.koji_exe

    # We are using this method to "tee" koji output to a log file and stdout
    def _process_koji_output(self, line):<commit_msg>Fix mock_base_packages list for the koji driver<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

# BuildRPMDriver derived classes expose the following methods:
#
# build_package(). This method will perform the actual package build using
#                  the driver-specific approach.

from dlrn.drivers.buildrpm import BuildRPMDriver
import dlrn.shell

import io
import logging
import os
import re
import sh

from time import localtime
from time import strftime
from time import time

logging.basicConfig(level=logging.ERROR,
                    format='%(asctime)s %(levelname)s:%(name)s:%(message)s')
logger = logging.getLogger("dlrn-build-koji")
logger.setLevel(logging.INFO)

# FIXME(jpena): needs to be configurable, and driver-independent
mock_base_packages = "basesystem rpm-build python2-devel gcc make "\
                     "python-sqlalchemy python-webob ghostscript graphviz "\
                     "python-sphinx python-eventlet python-six python-pbr "\
                     "openstack-macros git yum-plugin-priorities rubygems "\
                     "python-setuptools_scm"


class KojiBuildDriver(BuildRPMDriver):
    DRIVER_CONFIG = {
        'kojibuild_driver': {
            'koji_krb_principal': {'name': 'krb_principal'},
            'koji_krb_keytab': {'name': 'krb_keytab'},
            'koji_scratch_build': {'name': 'scratch_build', 'type': 'boolean',
                                   'default': True},
            'koji_build_target': {'name': 'build_target'},
            'koji_arch': {'name': 'arch', 'default': 'x86_64'},
            'koji_use_rhpkg': {'name': 'use_rhpkg', 'type': 'boolean'},
            'koji_exe': {'default': 'koji'},
            'fetch_mock_config': {'type': 'boolean'},
        }
    }

    def __init__(self, *args, **kwargs):
        super(KojiBuildDriver, self).__init__(*args, **kwargs)
        self.exe_name = self.config_options.koji_exe

    # We are using this method to "tee" koji output to a log file and stdout
    def _process_koji_output(self, line):
{'fraction_non_alphanumeric': 0.10706467661691542, 'fraction_numerical': 0.003582089552238806, 'mean_word_length': 3.072933549432739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5907371', 'n_tokens_mistral': 1486, 'n_tokens_neox': 1439, 'n_words': 449}