<commit_before># Copyright 2014 Google Inc. All rights reserved.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import unicode_literals

import setuptools

import caniusepython3 as ciu
import caniusepython3.__main__ as ciu_main
from caniusepython3 import pypi


class Command(setuptools.Command):

    description = """Run caniusepython3 over a setup.py file."""

    user_options = []

    def _dependencies(self):
        projects = []
        for attr in ('install_requires', 'tests_require'):
            requirements = getattr(self.distribution, attr, None) or []
            for project in requirements:
                if not project:
                    continue
                projects.append(pypi.just_name(project))
        extras = getattr(self.distribution, 'extras_require', None) or {}
        for value in extras.values():
            projects.extend(map(pypi.just_name, value))
        return projects

    def initialize_options(self):
        pass

    def run(self):
        ciu_main.check(self._dependencies())

    def finalize_options(self):
        pass
<commit_msg>command line interface returns with exit code 1 if any projects are not py3 compatible<commit_after># Copyright 2014 Google Inc. All rights reserved.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import unicode_literals

import setuptools
import sys

import caniusepython3 as ciu
import caniusepython3.__main__ as ciu_main
from caniusepython3 import pypi


class Command(setuptools.Command):

    description = """Run caniusepython3 over a setup.py file."""

    user_options = []

    def _dependencies(self):
        projects = []
        for attr in ('install_requires', 'tests_require'):
            requirements = getattr(self.distribution, attr, None) or []
            for project in requirements:
                if not project:
                    continue
                projects.append(pypi.just_name(project))
        extras = getattr(self.distribution, 'extras_require', None) or {}
        for value in extras.values():
            projects.extend(map(pypi.just_name, value))
        return projects

    def initialize_options(self):
        pass

    def run(self):
        if not ciu_main.check(self._dependencies()):
            sys.exit(1)

    def finalize_options(self):
        pass

{'fraction_non_alphanumeric': 0.07460890493381468, 'fraction_numerical': 0.008122743682310469, 'mean_word_length': 3.0205562273276905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3593512', 'n_tokens_mistral': 899, 'n_tokens_neox': 857, 'n_words': 335}