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

from distutils.core import setup
import pkg_resources
from setuptools import find_packages

from Cython.Distutils import build_ext as _build_ext
from distutils.extension import Extension


description = """
Collection of Deep Learning Computer Vision Algorithms implemented in Chainer
"""

ext_modules = [
    Extension('chainercv.utils.bbox._nms_gpu_post',
              ['chainercv/utils/bbox/_nms_gpu_post.pyx']),
]

setup_requires = ['numpy']
install_requires = [
    'chainer==2.0',
    'Cython',
    'Pillow'
]


class build_ext(_build_ext):
    def build_extensions(self):
        numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')

        for ext in self.extensions:
            if (hasattr(ext, 'include_dirs') and
                    numpy_incl not in ext.include_dirs):
                ext.include_dirs.append(numpy_incl)
        _build_ext.build_extensions(self)


cmdclass = {'build_ext': build_ext}


setup(
    name='chainercv',
    version='0.5.1',
    packages=find_packages(),
    author='<NAME>',
    author_email='<EMAIL>',
    license='MIT',
    description=description,
    setup_requires=setup_requires,
    install_requires=install_requires,
    include_package_data=True,
    # for Cython
    ext_modules=ext_modules,
    cmdclass=cmdclass,
)<commit_msg>no cython dependency<commit_after>#!/usr/bin/env python

from distutils.core import setup
import os
import pkg_resources
from setuptools import find_packages

from distutils.extension import Extension


description = """
Collection of Deep Learning Computer Vision Algorithms implemented in Chainer
"""


setup_requires = ['numpy']
install_requires = [
    'chainer==2.0',
    'Pillow'
]

try:
    from Cython.Distutils import build_ext as _build_ext
    suffix = '.pyx'
except ImportError:
    from distutils.command.build_ext import build_ext as _build_ext
    suffix = '.c'


class CheckingBuildExt(_build_ext):

    def check_cython_extensions(self, extensions):
        for ext in extensions:
            for src in ext.sources:
                if not os.path.exists(src):
                    print("{}: -> [{}]".format(ext.name, ext.sources))
                    raise Exception("""Cython-generated file '{}' not found.
                Cython is required to compile chainercv from a development
                branch. Please install Cython or
                download a release package of chainercv.
                """.format(src))

    def build_extensions(self):
        self.check_cython_extensions(self.extensions)

        # Include NumPy
        numpy_incl = pkg_resources.resource_filename('numpy', 'core/include')
        for ext in self.extensions:
            if (hasattr(ext, 'include_dirs') and
                    numpy_incl not in ext.include_dirs):
                ext.include_dirs.append(numpy_incl)
        _build_ext.build_extensions(self)


cmdclass = {'build_ext': CheckingBuildExt}


ext_data = {
    'utils.bbox._nms_gpu_post': {'pyxfile': 'utils/bbox/_nms_gpu_post'}
}

extensions = []
for name, data in ext_data.items():
    sources = [os.path.join('chainercv', data['pyxfile'] + suffix)]

    extensions.append(
        Extension('chainercv.{}'.format(name),
                  sources=sources)
    )


setup(
    name='chainercv',
    version='0.5.1',
    packages=find_packages(),
    author='<NAME>',
    author_email='<EMAIL>',
    license='MIT',
    description=description,
    setup_requires=setup_requires,
    install_requires=install_requires,
    include_package_data=True,
    # for Cython
    ext_modules=extensions,
    cmdclass=cmdclass,
)
{'fraction_non_alphanumeric': 0.1057134971018493, 'fraction_numerical': 0.002760143527463428, 'mean_word_length': 3.0856820744081173, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3150221', 'n_tokens_mistral': 1125, 'n_tokens_neox': 1092, 'n_words': 238}