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

from distribute_setup import use_setuptools
use_setuptools()

from setuptools import setup, find_packages
from glob import glob
import os

ext_modules = []

if os.getenv('ROOTPY_NO_EXT') not in ('1', 'true'):
    try:
        import numpy as np
        from distutils.core import Extension
        import distutils.util
        import subprocess

        root_inc = subprocess.Popen(
                ["root-config", "--incdir"],
                stdout=subprocess.PIPE).communicate()[0].strip()
        root_ldflags = subprocess.Popen(
                ["root-config", "--libs"],
                stdout=subprocess.PIPE).communicate()[0].strip().split()

        module = Extension(
                'rootpy.root2array.root_numpy._librootnumpy',
                sources=['rootpy/root2array/root_numpy/_librootnumpy.cxx'],
                include_dirs=[np.get_include(),
                              root_inc,
                              'rootpy/root2array/root_numpy/'],
                #extra_compile_args = root_cflags,
                extra_link_args=root_ldflags)
        ext_modules.append(module)
    except ImportError:
        # could not import numpy, so don't build numpy ext_modules
        pass<commit_msg>include python lib in ldflags<commit_after>#!/usr/bin/env python

from distribute_setup import use_setuptools
use_setuptools()

from setuptools import setup, find_packages
from glob import glob
import os

ext_modules = []

if os.getenv('ROOTPY_NO_EXT') not in ('1', 'true'):
    try:
        import numpy as np
        from distutils.core import Extension
        import subprocess
        import distutils.sysconfig

        python_lib = os.path.dirname(
                        distutils.sysconfig.get_python_lib(
                            standard_lib=True))

        root_inc = subprocess.Popen(
                ['root-config', '--incdir'],
                stdout=subprocess.PIPE).communicate()[0].strip()
        root_ldflags = subprocess.Popen(
                ['root-config', '--libs'],
                stdout=subprocess.PIPE).communicate()[0].strip().split()

        module = Extension(
                'rootpy.root2array.root_numpy._librootnumpy',
                sources=['rootpy/root2array/root_numpy/_librootnumpy.cxx'],
                include_dirs=[np.get_include(),
                              root_inc,
                              'rootpy/root2array/root_numpy/'],
                #extra_compile_args = root_cflags,
                extra_link_args=root_ldflags + ['-L%s' % python_lib])
        ext_modules.append(module)
    except ImportError:
        # could not import numpy, so don't build numpy ext_modules
        pass
{'fraction_non_alphanumeric': 0.10066617320503331, 'fraction_numerical': 0.0044411547002220575, 'mean_word_length': 2.0167410714285716, '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': '3642566', 'n_tokens_mistral': 786, 'n_tokens_neox': 750, 'n_words': 151}