<commit_before>import os

from ctasks \
    import \
        ccompile_task
from task_manager \
    import \
        extension
from task \
    import \
        Task
from compiled_fun \
    import \
        compile_fun

@extension(".pyx")
def cython_task(self, node):
    base = os.path.splitext(node)[0]
    target = base + ".c"
    task = Task("cython", inputs=node, outputs=target)
    task.env_vars = []
    task.env = self.env
    task.func = compile_fun("cython", "cython ${SRC}", False)[0]
    ctask = ccompile_task(self, target)
    self.object_tasks.extend(ctask)
    return [task] + ctask<commit_msg>ENH: add build dir support to cython task.<commit_after>import os

from ctasks \
    import \
        ccompile_task
from task_manager \
    import \
        extension
from task \
    import \
        Task
from compiled_fun \
    import \
        compile_fun
from utils \
    import \
        ensure_dir

@extension(".pyx")
def cython_task(self, node):
    base = os.path.splitext(node)[0]
    target = os.path.join(self.env["BLDDIR"], base + ".c")
    ensure_dir(target)
    task = Task("cython", inputs=node, outputs=target)
    task.env_vars = []
    task.env = self.env
    task.func = compile_fun("cython", "cython ${SRC} -o ${TGT}",
                            False)[0]
    ctask = ccompile_task(self, target)
    self.object_tasks.extend(ctask)
    return [task] + ctask
{'fraction_non_alphanumeric': 0.12274368231046931, 'fraction_numerical': 0.002888086642599278, 'mean_word_length': 2.4392059553349874, 'pattern_counts': {'":': 0, '<': 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': '6378318', 'n_tokens_mistral': 459, 'n_tokens_neox': 463, 'n_words': 106}