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

import sys

from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize

enable_cuda = False
if "--enable-cuda" in sys.argv:
    enable_cuda = True
    sys.argv.remove("--enable-cuda")

ext_modules = [
    Extension("primitiv._shape",
              sources=["primitiv/_shape.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv._tensor",
              sources=["primitiv/_tensor.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv._device",
              sources=["primitiv/_device.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv.devices._naive_device",
              sources=["primitiv/devices/_naive_device.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv._parameter",
              sources=["primitiv/_parameter.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv._initializer",
              sources=["primitiv/_initializer.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv.initializers._initializer_impl",
              sources=["primitiv/initializers/_initializer_impl.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv._graph",
              sources=["primitiv/_graph.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv._trainer",
              sources=["primitiv/_trainer.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv.trainers._trainer_impl",
              sources=["primitiv/trainers/_trainer_impl.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
    Extension("primitiv._operator",
              sources=["primitiv/_operator.pyx"],
              language="c++",
              libraries=["primitiv"],
              extra_compile_args=["-std=c++11"],
    ),
]

if enable_cuda:
    ext_modules.append(
        Extension("primitiv.devices._cuda_device",
                  sources=["primitiv/devices/_cuda_device.pyx"],
                  language="c++",
                  libraries=["primitiv"],
                  extra_compile_args=["-std=c++11"],
        )
    )

setup(
    name = "primitiv",
    version = "0.0.1",
    description = "primitiv: A Neural Network Toolkit. (Python frontend)",
    url = "https://github.com/odashi/primitiv",
    author = "<NAME>",
    author_email = "<EMAIL>",
    classifiers=[
        "Development Status :: 3 - Alpha",<commit_msg>Specify directory of numpy header files, and simplify setup.py<commit_after>#!/usr/bin/env python3

import sys
import numpy as np

from setuptools import setup
from distutils.extension import Extension
from Cython.Build import cythonize

enable_cuda = False
if "--enable-cuda" in sys.argv:
    enable_cuda = True
    sys.argv.remove("--enable-cuda")

def extension_common_args(*args, **kwargs):
    return Extension(*args, **kwargs,
        language="c++",
        libraries=["primitiv"],
        include_dirs=[np.get_include()],
        extra_compile_args=["-std=c++11"],
    )

ext_modules = [
    extension_common_args("primitiv._shape",
                          sources=["primitiv/_shape.pyx"]),
    extension_common_args("primitiv._tensor",
                          sources=["primitiv/_tensor.pyx"]),
    extension_common_args("primitiv._device",
                          sources=["primitiv/_device.pyx"]),
    extension_common_args("primitiv.devices._naive_device",
                          sources=["primitiv/devices/_naive_device.pyx"]),
    extension_common_args("primitiv._parameter",
                          sources=["primitiv/_parameter.pyx"]),
    extension_common_args("primitiv._initializer",
                          sources=["primitiv/_initializer.pyx"]),
    extension_common_args("primitiv.initializers._initializer_impl",
                          sources=["primitiv/initializers/_initializer_impl.pyx"]),
    extension_common_args("primitiv._graph",
                          sources=["primitiv/_graph.pyx"]),
    extension_common_args("primitiv._trainer",
                          sources=["primitiv/_trainer.pyx"]),
    extension_common_args("primitiv.trainers._trainer_impl",
                          sources=["primitiv/trainers/_trainer_impl.pyx"]),
    extension_common_args("primitiv._operator",
                          sources=["primitiv/_operator.pyx"]),
]

if enable_cuda:
    ext_modules.append(extension_common_args("primitiv.devices._cuda_device",
                                             sources=["primitiv/devices/_cuda_device.pyx"]))

setup(
    name = "primitiv",
    version = "0.0.1",
    description = "primitiv: A Neural Network Toolkit. (Python frontend)",
    url = "https://github.com/odashi/primitiv",
    author = "<NAME>",
    author_email = "<EMAIL>",
    classifiers=[
        "Development Status :: 3 - Alpha",
{'fraction_non_alphanumeric': 0.14833804809052334, 'fraction_numerical': 0.006364922206506365, 'mean_word_length': 2.2870424171993027, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '2726103', 'n_tokens_mistral': 1680, 'n_tokens_neox': 1684, 'n_words': 210}