<commit_before>from   glob import glob
import os
from   setuptools import setup, Extension
import setuptools.command.build_ext
import setuptools.command.install
import subprocess
import sys

#-------------------------------------------------------------------------------

if sys.platform == "darwin":
    # No C++14 when building for earlier OSX versions.
    os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.9"


#-------------------------------------------------------------------------------

# Convince setuptools to call our C++ build.

class BuildExt(setuptools.command.build_ext.build_ext):

    def run(self):
        subprocess.check_call(["make", "lib-cxx"])
        super().run()



class Install(setuptools.command.install.install):

    def run(self):
        subprocess.check_call(["make", "install-cxx"])
        super().run()



#-------------------------------------------------------------------------------

setup(
    cmdclass={
        "build_ext" : BuildExt,
        "install"   : Install,
    },
    name="fixfmt",
    package_dir={"": "python"},
    packages=["fixfmt"],
    ext_modules=[
        Extension(
            "fixfmt._ext",<commit_msg>For Python 2.7 compatibility.<commit_after>from   glob import glob
import os
from   setuptools import setup, Extension
import setuptools.command.build_ext
import setuptools.command.install
import subprocess
import sys

#-------------------------------------------------------------------------------

if sys.platform == "darwin":
    # No C++14 when building for earlier OSX versions.
    os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.9"


#-------------------------------------------------------------------------------

# Convince setuptools to call our C++ build.

class BuildExt(setuptools.command.build_ext.build_ext):

    def run(self):
        subprocess.check_call(["make", "lib-cxx"])
        super(BuildExt, self).run()



class Install(setuptools.command.install.install):

    def run(self):
        subprocess.check_call(["make", "install-cxx"])
        super(Install, self).run()



#-------------------------------------------------------------------------------

setup(
    cmdclass={
        "build_ext" : BuildExt,
        "install"   : Install,
    },
    name="fixfmt",
    package_dir={"": "python"},
    packages=["fixfmt"],
    ext_modules=[
        Extension(
            "fixfmt._ext",
{'fraction_non_alphanumeric': 0.30458561211611274, 'fraction_numerical': 0.005048380311316786, 'mean_word_length': 1.5460385438972162, 'pattern_counts': {'":': 4, '<': 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': '4677923', 'n_tokens_mistral': 642, 'n_tokens_neox': 620, 'n_words': 136}