<commit_before>import os
import fnmatch
from setuptools import setup, find_packages
from codecs import open

here = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()


def schema_files():
    '''Return all CSV and JSON files paths in datapackage/schemas

    The paths are relative to ./datapackage
    '''
    def recursive_glob(path, patterns):
        results = []
        for base, dirs, files in os.walk(path):
            matching_files = []
            for pattern in patterns:
                matching_files.extend(fnmatch.filter(files, pattern))
            results.extend(os.path.join(base, f) for f in matching_files)
        return results

    base_folder = 'datapackage'
    remove_base_folder = lambda path: path[len(base_folder) + 1:]

    path = os.path.join(base_folder, 'schemas')
    files_paths = recursive_glob(path, ['*.csv', '*.json'])

    return [remove_base_folder(f) for f in files_paths]


setup(
    name='datapackage',
    version='0.0.1',
    description=(
        'Utilities to work with Data Packages as defined on dataprotocols.org'
    ),
    long_description=long_description,

    url='https://github.com/okfn/datapackage-py',

    author='Open Knowledge Foundation',
    author_email='<EMAIL>',

    license='MIT',

    classifiers=[
        'Development Status :: 3 - Alpha',

        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'Topic :: Utilities',

        'License :: OSI Approved :: MIT License',

        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],

    keywords='data dataprotocols jsontableschema openrefine datascience',

    packages=find_packages(exclude=['tests']),
    package_data={'datapackage': schema_files()},

    install_requires=[
        'six >= 1.10.0',
        'requests >= 2.8.0',
        'jsonschema >= 2.5.1',
        'tabulator >= 0.3.6',
        'jsontableschema >= 0.5.1',
        'unicodecsv>=0.14',
    ],

    obsoletes=[
        'datapackage-registry',
        'datapackage-validate',
    ],
)<commit_msg>Revert "Add "obsoletes" notice on setup.py"<commit_after>import os
import fnmatch
from setuptools import setup, find_packages
from codecs import open

here = os.path.abspath(os.path.dirname(__file__))

with open(os.path.join(here, 'README.md'), encoding='utf-8') as f:
    long_description = f.read()


def schema_files():
    '''Return all CSV and JSON files paths in datapackage/schemas

    The paths are relative to ./datapackage
    '''
    def recursive_glob(path, patterns):
        results = []
        for base, dirs, files in os.walk(path):
            matching_files = []
            for pattern in patterns:
                matching_files.extend(fnmatch.filter(files, pattern))
            results.extend(os.path.join(base, f) for f in matching_files)
        return results

    base_folder = 'datapackage'
    remove_base_folder = lambda path: path[len(base_folder) + 1:]

    path = os.path.join(base_folder, 'schemas')
    files_paths = recursive_glob(path, ['*.csv', '*.json'])

    return [remove_base_folder(f) for f in files_paths]


setup(
    name='datapackage',
    version='0.0.1',
    description=(
        'Utilities to work with Data Packages as defined on dataprotocols.org'
    ),
    long_description=long_description,

    url='https://github.com/okfn/datapackage-py',

    author='Open Knowledge Foundation',
    author_email='<EMAIL>',

    license='MIT',

    classifiers=[
        'Development Status :: 3 - Alpha',

        'Intended Audience :: Developers',
        'Intended Audience :: Information Technology',
        'Topic :: Utilities',

        'License :: OSI Approved :: MIT License',

        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],

    keywords='data dataprotocols jsontableschema openrefine datascience',

    packages=find_packages(exclude=['tests']),
    package_data={'datapackage': schema_files()},

    install_requires=[
        'six >= 1.10.0',
        'requests >= 2.8.0',
        'jsonschema >= 2.5.1',
        'tabulator >= 0.3.6',
        'jsontableschema >= 0.5.1',
        'unicodecsv>=0.14',
    ],
)
{'fraction_non_alphanumeric': 0.13367437722419928, 'fraction_numerical': 0.014679715302491103, 'mean_word_length': 2.8110169491525423, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '2507202', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1359, 'n_words': 330}