<commit_before>#!/usr/bin/env python
from __future__ import print_function
from setuptools import setup, find_packages
from os import path
import codecs
import os
import re
import sys


# When creating the sdist, make sure the django.mo file also exists:
if 'sdist' in sys.argv or 'develop' in sys.argv:
    try:
        os.chdir('fluent_comments')
        # from django.core.management.commands.compilemessages import Command
        # Command.compile_messages(sys.stderr)
    finally:
        os.chdir('..')


def read(*parts):
    file_path = path.join(path.dirname(__file__), *parts)
    return codecs.open(file_path, encoding='utf-8').read()


def find_version(*parts):
    version_file = read(*parts)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
    if version_match:
        return str(version_match.group(1))
    raise RuntimeError("Unable to find version string.")

install_requires=[
    'django-crispy-forms>=1.1.1',
    'django-tag-parser>=2.1',
]

if sys.version_info[0] >= 3:
    # Akismet 0.2 does not support Python 3.
    if 'install' in sys.argv or 'develop' in sys.argv:
        print("\nwarning: skipped Akismet as dependency because it does not have a Python 3 version.")
else:<commit_msg>setup.py: improve .mo file compiling<commit_after>#!/usr/bin/env python
from __future__ import print_function
from setuptools import setup, find_packages
from os import path
import codecs
import os
import re
import sys


# When creating the sdist, make sure the django.mo file also exists:
if 'sdist' in sys.argv or 'develop' in sys.argv:
    os.chdir('fluent_comments')
    try:
        from django.core import management
        management.call_command('compilemessages', stdout=sys.stderr, verbosity=1)
    except ImportError:
        if 'sdist' in sys.argv:
            raise
    finally:
        os.chdir('..')


def read(*parts):
    file_path = path.join(path.dirname(__file__), *parts)
    return codecs.open(file_path, encoding='utf-8').read()


def find_version(*parts):
    version_file = read(*parts)
    version_match = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_file, re.M)
    if version_match:
        return str(version_match.group(1))
    raise RuntimeError("Unable to find version string.")

install_requires=[
    'django-crispy-forms>=1.1.1',
    'django-tag-parser>=2.1',
]

if sys.version_info[0] >= 3:
    # Akismet 0.2 does not support Python 3.
    if 'install' in sys.argv or 'develop' in sys.argv:
        print("\nwarning: skipped Akismet as dependency because it does not have a Python 3 version.")
else:
{'fraction_non_alphanumeric': 0.1272098385857033, 'fraction_numerical': 0.01037663335895465, 'mean_word_length': 3.566666666666667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '840660', 'n_tokens_mistral': 847, 'n_tokens_neox': 825, 'n_words': 238}