<commit_before>#!/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import os
import sys

from setuptools import find_packages, setup

REQUIRES = [
    'dnspython>=1.11.1',
    'psutil>=1.2.1',
    'python-dateutil>=2.5',
    'python-termstyle>=0.1.10',
    'pytz>=2012c',
    'redis>=2.10',
    'requests>=2.2.0',
]

exec(open(os.path.join(os.path.dirname(__file__),
                       'intelmq/version.py')).read())  # defines __version__
BOTS = []
bots = json.load(open(os.path.join(os.path.dirname(__file__), 'intelmq/bots/BOTS')))
for bot_type, bots in bots.items():
    for bot_name, bot in bots.items():
        module = bot['module']
        BOTS.append('{0} = {0}:BOT.run'.format(module))

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as handle:
    README = handle.read()

setup(
    name='intelmq',
    version=__version__,  # noqa: F821
    maintainer='<NAME>',
    maintainer_email='<EMAIL>',
    python_requires='>=3.6',
    install_requires=REQUIRES,
    tests_require=[
        'Cerberus!=1.3',
        'pyyaml',
        'requests_mock',
    ],
    test_suite='intelmq.tests',
    extras_require={
        'development': [
            'Cerberus',
            'pyyaml',
        ],
    },
    packages=find_packages(),
    include_package_data=True,
    url='https://github.com/certtools/intelmq/',
    project_urls={
        'Documentation': 'https://intelmq.readthedocs.io/',
        'Source and Issue Tracker': 'https://github.com/certtools/intelmq/',
    },
    license='AGPLv3',<commit_msg>[FIX] setup.py load bots module-names dynamically<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-
import json
import os
import sys
from pathlib import Path

from setuptools import find_packages, setup

REQUIRES = [
    'dnspython>=1.11.1',
    'psutil>=1.2.1',
    'python-dateutil>=2.5',
    'python-termstyle>=0.1.10',
    'pytz>=2012c',
    'redis>=2.10',
    'requests>=2.2.0',
]

exec(open(os.path.join(os.path.dirname(__file__),
                       'intelmq/version.py')).read())  # defines __version__
BOTS = []

base_path = Path(__file__).parent / 'intelmq/bots'
botfiles = [botfile for botfile in Path(base_path).glob('**/*.py') if botfile.is_file() and not botfile.name.startswith('_')]
for file in botfiles:
    module = '.'.join(file.with_suffix('').parts)
    BOTS.append('{0} = {0}:BOT.run'.format(module))

with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as handle:
    README = handle.read()

setup(
    name='intelmq',
    version=__version__,  # noqa: F821
    maintainer='<NAME>',
    maintainer_email='<EMAIL>',
    python_requires='>=3.6',
    install_requires=REQUIRES,
    tests_require=[
        'Cerberus!=1.3',
        'pyyaml',
        'requests_mock',
    ],
    test_suite='intelmq.tests',
    extras_require={
        'development': [
            'Cerberus',
            'pyyaml',
        ],
    },
    packages=find_packages(),
    include_package_data=True,
    url='https://github.com/certtools/intelmq/',
    project_urls={
        'Documentation': 'https://intelmq.readthedocs.io/',
        'Source and Issue Tracker': 'https://github.com/certtools/intelmq/',
    },
    license='AGPLv3',
{'fraction_non_alphanumeric': 0.17890772128060264, 'fraction_numerical': 0.02197112366603892, 'mean_word_length': 2.98375, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 23, 'https://': 6, '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': '841157', 'n_tokens_mistral': 1191, 'n_tokens_neox': 1167, 'n_words': 175}