<commit_before>#!/usr/bin/env python


from setuptools import setup, find_packages, Extension
import subprocess
import os
from distutils import ccompiler

VERSION = (0, 8, 0)
VERSION_STR = ".".join([str(x) for x in VERSION])
LZ4_VERSION = "r130"

# Check to see if we have a lz4 library installed on the system and
# use it if so. If not, we'll use the bundled library. If lz4 is
# installed it will have a pkg-config file, so we'll use pkg-config to
# check for existence of the library.
pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config'
cmd = '{0} --exists liblz4'.format(pkg_config_exe).split()
liblz4_found = subprocess.call(cmd) == 0

if liblz4_found:
    # Use system lz4, and don't set optimization and warning flags for
    # the compiler. Specifically we don't define LZ4_VERSION since the
    # system lz4 library could be updated (that's the point of a
    # shared library).
    if ccompiler.get_default_compiler() == "msvc":
        extra_compile_args = ["/Ot", "/Wall"]
        define_macros = [("VERSION","\\\"%s\\\"" % VERSION_STR),]
    else:
        extra_compile_args = ["-std=c99",]
        define_macros = [("VERSION","\"%s\"" % VERSION_STR),]

    lz4mod = Extension('lz4',
                       [
                           'src/python-lz4.c'
                       ],
                       extra_compile_args=extra_compile_args,
                       define_macros=define_macros,
                       libraries=['lz4'],
    )
else:
    # Use the bundled lz4 libs, and set the compiler flags as they
    # historically have been set. We do set LZ4_VERSION here, since it
    # won't change after compilation.
    if ccompiler.get_default_compiler() == "msvc":
        extra_compile_args = ["/Ot", "/Wall"]
        define_macros = [("VERSION","\\\"%s\\\"" % VERSION_STR), ("LZ4_VERSION","\\\"%s\\\"" % LZ4_VERSION)]
    else:
        extra_compile_args = ["-std=c99","-O3","-Wall","-W","-Wundef"]
        define_macros = [("VERSION","\"%s\"" % VERSION_STR), ("LZ4_VERSION","\"%s\"" % LZ4_VERSION)]

    lz4mod = Extension('lz4',
                       [
                           'src/lz4.c',
                           'src/lz4hc.c',
                           'src/python-lz4.c'
                       ],
                       extra_compile_args=extra_compile_args,
                       define_macros=define_macros,
    )


setup(
    name='lz4',
    version=VERSION_STR,
    description="LZ4 Bindings for Python",
    long_description=open('README.rst', 'r').read(),
    author='<NAME>',
    author_email='<EMAIL>',
    url='https://github.com/steeve/python-lz4',
    packages=find_packages('src'),
    package_dir={'': 'src'},
    ext_modules=[lz4mod,],
    tests_require=["nose>=1.0"],
    test_suite = "nose.collector",
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'License :: OSI Approved :: BSD License',
        'Intended Audience :: Developers',
        'Programming Language :: C',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
    ],
)<commit_msg>Add PyPi classifiers for Python 3.4 and 3.5<commit_after>#!/usr/bin/env python


from setuptools import setup, find_packages, Extension
import subprocess
import os
from distutils import ccompiler

VERSION = (0, 8, 0)
VERSION_STR = ".".join([str(x) for x in VERSION])
LZ4_VERSION = "r130"

# Check to see if we have a lz4 library installed on the system and
# use it if so. If not, we'll use the bundled library. If lz4 is
# installed it will have a pkg-config file, so we'll use pkg-config to
# check for existence of the library.
pkg_config_exe = os.environ.get('PKG_CONFIG', None) or 'pkg-config'
cmd = '{0} --exists liblz4'.format(pkg_config_exe).split()
liblz4_found = subprocess.call(cmd) == 0

if liblz4_found:
    # Use system lz4, and don't set optimization and warning flags for
    # the compiler. Specifically we don't define LZ4_VERSION since the
    # system lz4 library could be updated (that's the point of a
    # shared library).
    if ccompiler.get_default_compiler() == "msvc":
        extra_compile_args = ["/Ot", "/Wall"]
        define_macros = [("VERSION","\\\"%s\\\"" % VERSION_STR),]
    else:
        extra_compile_args = ["-std=c99",]
        define_macros = [("VERSION","\"%s\"" % VERSION_STR),]

    lz4mod = Extension('lz4',
                       [
                           'src/python-lz4.c'
                       ],
                       extra_compile_args=extra_compile_args,
                       define_macros=define_macros,
                       libraries=['lz4'],
    )
else:
    # Use the bundled lz4 libs, and set the compiler flags as they
    # historically have been set. We do set LZ4_VERSION here, since it
    # won't change after compilation.
    if ccompiler.get_default_compiler() == "msvc":
        extra_compile_args = ["/Ot", "/Wall"]
        define_macros = [("VERSION","\\\"%s\\\"" % VERSION_STR), ("LZ4_VERSION","\\\"%s\\\"" % LZ4_VERSION)]
    else:
        extra_compile_args = ["-std=c99","-O3","-Wall","-W","-Wundef"]
        define_macros = [("VERSION","\"%s\"" % VERSION_STR), ("LZ4_VERSION","\"%s\"" % LZ4_VERSION)]

    lz4mod = Extension('lz4',
                       [
                           'src/lz4.c',
                           'src/lz4hc.c',
                           'src/python-lz4.c'
                       ],
                       extra_compile_args=extra_compile_args,
                       define_macros=define_macros,
    )


setup(
    name='lz4',
    version=VERSION_STR,
    description="LZ4 Bindings for Python",
    long_description=open('README.rst', 'r').read(),
    author='<NAME>',
    author_email='<EMAIL>',
    url='https://github.com/steeve/python-lz4',
    packages=find_packages('src'),
    package_dir={'': 'src'},
    ext_modules=[lz4mod,],
    tests_require=["nose>=1.0"],
    test_suite = "nose.collector",
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'License :: OSI Approved :: BSD License',
        'Intended Audience :: Developers',
        'Programming Language :: C',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],
)
{'fraction_non_alphanumeric': 0.14426330359889264, 'fraction_numerical': 0.016610273761919408, 'mean_word_length': 2.3382956878850103, 'pattern_counts': {'":': 4, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3556598', 'n_tokens_mistral': 2140, 'n_tokens_neox': 2051, 'n_words': 507}