<commit_before>import logging
import subprocess

from hotness.cache import cache

log = logging.getLogger('fedmsg')

def get_version(package_name, yumconfig):
    nvr_dict = build_nvr_dict(yumconfig)
    return nvr_dict[package_name]


@cache.cache_on_arguments()
def build_nvr_dict(yumconfig):
    cmdline = ["/usr/bin/repoquery",
               "--config", yumconfig,
               "--quiet",
               "--archlist=src",
               "--all",
               "--qf",
               "%{name}\t%{version}\t%{release}"]

    log.info("Running %r" % ' '.join(cmdline))
    repoquery = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
    (stdout, stderr) = repoquery.communicate()<commit_msg>Drop explicit archlist for now.<commit_after>import logging
import subprocess

from hotness.cache import cache

log = logging.getLogger('fedmsg')

def get_version(package_name, yumconfig):
    nvr_dict = build_nvr_dict(yumconfig)
    return nvr_dict[package_name]


@cache.cache_on_arguments()
def build_nvr_dict(yumconfig):
    cmdline = ["/usr/bin/repoquery",
               "--config", yumconfig,
               "--quiet",
               #"--archlist=src",
               "--all",
               "--qf",
               "%{name}\t%{version}\t%{release}"]

    log.info("Running %r" % ' '.join(cmdline))
    repoquery = subprocess.Popen(cmdline, stdout=subprocess.PIPE)
    (stdout, stderr) = repoquery.communicate()
{'fraction_non_alphanumeric': 0.14416961130742048, 'fraction_numerical': 0.0, 'mean_word_length': 2.7263157894736842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4496396', 'n_tokens_mistral': 462, 'n_tokens_neox': 456, 'n_words': 79}