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

import os
import sys

from distutils.core import setup, Command

name_ = 'chemreac'
version_ = '0.2.0-dev'

DEBUG = True if os.environ.get('USE_DEBUG', False) else False
USE_OPENMP = True if os.environ.get('USE_OPENMP', False) else False

# Make `python setup.py test` work without depending on py.test being installed
# https://pytest.org/latest/goodpractises.html
class PyTest(Command):
    user_options = []
    def initialize_options(self):
        pass
    def finalize_options(self):
        pass
    def run(self):
        import sys,subprocess
        # py.test --genscript=runtests.py
        errno = subprocess.call([sys.executable, 'runtests.py'])
        raise SystemExit(errno)

cmdclass_ = {'test': PyTest}

if '--help'in sys.argv[1:] or sys.argv[1] in (
        '--help-commands', 'egg_info', 'clean', '--version'):
    # Enbale pip to probe setup.py before all requirements are installed
    ext_modules_ = []
else:
    import pickle
    from pycompilation.dist import clever_build_ext, CleverExtension
    cmdclass_['build_ext'] = clever_build_ext
    subsd = {'USE_OPENMP': USE_OPENMP}
    ext_modules_ = [
        CleverExtension(
            "chemreac._chemreac",
            sources=[
                'src/chemreac_template.cpp',
                'src/finitediff/finitediff/fornberg.f90',
                'src/finitediff/finitediff/c_fornberg.f90',
                'chemreac/_chemreac.pyx',
            ],
            template_regexps=[
                (r'^(\w+)_template.(\w+)$', r'\1.\2', subsd),
            ],
            pycompilation_compile_kwargs={
                'per_file_kwargs': {
                    'src/chemreac.cpp': {
                        'std': 'c++0x',
                        'options': ['pic', 'warn', 'fast'] +\
                        (['openmp'] if USE_OPENMP else []),
                        'defmacros': ['restrict=__restrict__', 'DEBUG']+\
                        (['DEBUG'] if DEBUG else []),
                    },
                },
                'defmacros': ['restrict=__restrict__'],
            },
            pycompilation_link_kwargs={<commit_msg>Relax -march=native for testing.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-

import os
import sys

from distutils.core import setup, Command

name_ = 'chemreac'
version_ = '0.2.0-dev'

DEBUG = True if os.environ.get('USE_DEBUG', False) else False
USE_OPENMP = True if os.environ.get('USE_OPENMP', False) else False

# Make `python setup.py test` work without depending on py.test being installed
# https://pytest.org/latest/goodpractises.html
class PyTest(Command):
    user_options = []
    def initialize_options(self):
        pass
    def finalize_options(self):
        pass
    def run(self):
        import sys,subprocess
        # py.test --genscript=runtests.py
        errno = subprocess.call([sys.executable, 'runtests.py'])
        raise SystemExit(errno)

cmdclass_ = {'test': PyTest}

if '--help'in sys.argv[1:] or sys.argv[1] in (
        '--help-commands', 'egg_info', 'clean', '--version'):
    # Enbale pip to probe setup.py before all requirements are installed
    ext_modules_ = []
else:
    import pickle
    from pycompilation.dist import clever_build_ext, CleverExtension
    cmdclass_['build_ext'] = clever_build_ext
    subsd = {'USE_OPENMP': USE_OPENMP}
    ext_modules_ = [
        CleverExtension(
            "chemreac._chemreac",
            sources=[
                'src/chemreac_template.cpp',
                'src/finitediff/finitediff/fornberg.f90',
                'src/finitediff/finitediff/c_fornberg.f90',
                'chemreac/_chemreac.pyx',
            ],
            template_regexps=[
                (r'^(\w+)_template.(\w+)$', r'\1.\2', subsd),
            ],
            pycompilation_compile_kwargs={
                'per_file_kwargs': {
                    'src/chemreac.cpp': {
                        'std': 'c++0x',
                        # 'fast' doesn't work on drone.io
                        'options': ['pic', 'warn'] +\
                        (['openmp'] if USE_OPENMP else []),
                        'defmacros': ['restrict=__restrict__', 'DEBUG']+\
                        (['DEBUG'] if DEBUG else []),
                    },
                },
                'defmacros': ['restrict=__restrict__'],
            },
            pycompilation_link_kwargs={
{'fraction_non_alphanumeric': 0.13346929526399276, 'fraction_numerical': 0.005891683661907999, 'mean_word_length': 1.9505347593582887, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '840999', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1332, 'n_words': 276}