<commit_before>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

from distutils.command.build_scripts import build_scripts
from distutils import util, log

try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension


if '--with-cython' in sys.argv:
    from Cython.Distutils import build_ext
    sys.argv.remove('--with-cython')
    use_cython = True
else:
    use_cython = False


class build_scripts_rename(build_scripts):
    def copy_scripts(self):
        build_scripts.copy_scripts(self)
        # remove the .py extension from scripts
        for s in self.scripts:
            f = util.convert_path(s)
            before = os.path.join(self.build_dir, os.path.basename(f))
            after = os.path.splitext(before)[0]
            log.info("renaming %s -> %s" % (before, after))
            os.rename(before, after)


cmdclass = {
    'build_scripts': build_scripts_rename
}

ext_modules = [
    Extension(
        'liblo',
        [use_cython and 'src/liblo.pyx' or 'src/liblo.c'],
        extra_compile_args = [
            '-fno-strict-aliasing',
            '-Werror-implicit-function-declaration',
            '-Wfatal-errors',
        ],
        libraries = ['lo']
    )
]

if use_cython:
    cmdclass['build_ext'] = build_ext


setup(
    name = 'pyliblo',
    version = '0.10.0',
    author = '<NAME>',
    author_email = '<EMAIL>',
    url = 'http://das.nasophon.de/pyliblo/',
    description = 'Python bindings for the liblo OSC library',
    license = 'LGPL',
    scripts = [
        'scripts/send_osc.py',
        'scripts/dump_osc.py',
    ],<commit_msg>make Cython a hard build dependency<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

from distutils.command.build_scripts import build_scripts
from distutils import util, log

try:
    from setuptools import setup, Extension
except ImportError:
    from distutils.core import setup, Extension

from Cython.Distutils import build_ext


class build_scripts_rename(build_scripts):
    def copy_scripts(self):
        build_scripts.copy_scripts(self)
        # remove the .py extension from scripts
        for s in self.scripts:
            f = util.convert_path(s)
            before = os.path.join(self.build_dir, os.path.basename(f))
            after = os.path.splitext(before)[0]
            log.info("renaming %s -> %s" % (before, after))
            os.rename(before, after)


cmdclass = {
    'build_scripts': build_scripts_rename,
    'build_ext': build_ext,
}

ext_modules = [
    Extension(
        'liblo',
        ['src/liblo.pyx'],
        extra_compile_args = [
            '-fno-strict-aliasing',
            '-Werror-implicit-function-declaration',
            '-Wfatal-errors',
        ],
        libraries = ['lo'],
    )
]


setup(
    name = 'pyliblo',
    version = '0.10.0',
    author = '<NAME>',
    author_email = '<EMAIL>',
    url = 'http://das.nasophon.de/pyliblo/',
    description = 'Python bindings for the liblo OSC library',
    license = 'LGPL',
    scripts = [
        'scripts/send_osc.py',
        'scripts/dump_osc.py',
    ],
{'fraction_non_alphanumeric': 0.12670689107653224, 'fraction_numerical': 0.003810733566211496, 'mean_word_length': 2.438864628820961, 'pattern_counts': {'":': 0, '<': 7, '<?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': '5114552', 'n_tokens_mistral': 1022, 'n_tokens_neox': 1026, 'n_words': 225}