<commit_before># Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack import *


class PyLineProfiler(PythonPackage):
    """Line-by-line profiler."""

    homepage = "https://github.com/rkern/line_profiler"
    url      = "https://pypi.io/packages/source/l/line_profiler/line_profiler-2.0.tar.gz"

    version('2.0', 'fc93c6bcfac3b7cb1912cb28836d7ee6')

    depends_on('python@2.5:')
    depends_on('py-setuptools',     type='build')
    depends_on('py-cython',         type='build')
    depends_on('py-ipython@0.13:',  type=('build', 'run'))<commit_msg>py-line-profiler: add 2.1.2, re-run cython if needed (#13102)<commit_after># Copyright 2013-2019 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

import os

from spack import *


class PyLineProfiler(PythonPackage):
    """Line-by-line profiler."""

    homepage = "https://github.com/rkern/line_profiler"
    url      = "https://pypi.io/packages/source/l/line_profiler/line_profiler-2.0.tar.gz"

    version('2.1.2', sha256='efa66e9e3045aa7cb1dd4bf0106e07dec9f80bc781a993fbaf8162a36c20af5c')
    version('2.0', 'fc93c6bcfac3b7cb1912cb28836d7ee6')

    depends_on('python@2.5:', type=('build', 'run'))
    depends_on('py-setuptools',     type='build')
    depends_on('py-cython',         type='build')
    depends_on('py-ipython@0.13:',  type=('build', 'run'))

    # See https://github.com/rkern/line_profiler/issues/166
    @run_before('build')
    @when('^python@3.7:')
    def fix_cython(self):
        cython = self.spec['py-cython'].command
        for root, _, files in os.walk('.'):
            for fn in files:
                if fn.endswith('.pyx'):
                    cython(os.path.join(root, fn))
{'fraction_non_alphanumeric': 0.15467625899280577, 'fraction_numerical': 0.0632065775950668, 'mean_word_length': 3.5490654205607477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6959238', 'n_tokens_mistral': 769, 'n_tokens_neox': 718, 'n_words': 123}