<commit_before>#!/usr/bin/env python
# Generic setup script for single-package Python projects
# by <NAME> <thp.io/about>

from distutils.core import setup

import re
import os
import glob

PACKAGE = 'feedservice'
SCRIPT_FILE = os.path.join(PACKAGE, '__init__.py')

main_py = open(SCRIPT_FILE).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
docstrings = re.findall('"""(.*?)"""', main_py, re.DOTALL)

# List the packages that need to be installed/packaged
PACKAGES = (
        PACKAGE,
        'feedservice.parse',
        'feedservice.pubsubhubbub',
        'feedservice.urlstore',
)

SCRIPTS = glob.glob('scripts/*')

# Metadata fields extracted from SCRIPT_FILE
AUTHOR_EMAIL = metadata['author']
VERSION = metadata['version']
WEBSITE = metadata['website']
LICENSE = metadata['license']
DESCRIPTION = docstrings[0].strip()
if '\n\n' in DESCRIPTION:
    DESCRIPTION, LONG_DESCRIPTION = DESCRIPTION.split('\n\n', 1)
else:
    LONG_DESCRIPTION = None

# Extract name and e-mail ("Firstname Lastname <<EMAIL>>")
AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()

setup(name=PACKAGE,
      version=VERSION,
      description=DESCRIPTION,
      long_description=LONG_DESCRIPTION,
      author=AUTHOR,
      author_email=EMAIL,
      license=LICENSE,
      url=WEBSITE,
      packages=PACKAGES,
      scripts=SCRIPTS,
      download_url=WEBSITE+PACKAGE+'-'+VERSION+'.tar.gz')

<commit_msg>include couchdb ddocs and templates in setup.py<commit_after>#!/usr/bin/env python
# Generic setup script for single-package Python projects
# by <NAME> <thp.io/about>

from distutils.core import setup

import re
import os
import glob

PACKAGE = 'feedservice'
SCRIPT_FILE = os.path.join(PACKAGE, '__init__.py')

main_py = open(SCRIPT_FILE).read()
metadata = dict(re.findall("__([a-z]+)__ = '([^']+)'", main_py))
docstrings = re.findall('"""(.*?)"""', main_py, re.DOTALL)

# List the packages that need to be installed/packaged
PACKAGES = (
        PACKAGE,
        'feedservice.parse',
        'feedservice.pubsubhubbub',
        'feedservice.urlstore',
)

SCRIPTS = glob.glob('scripts/*')

# Metadata fields extracted from SCRIPT_FILE
AUTHOR_EMAIL = metadata['author']
VERSION = metadata['version']
WEBSITE = metadata['website']
LICENSE = metadata['license']
DESCRIPTION = docstrings[0].strip()
if '\n\n' in DESCRIPTION:
    DESCRIPTION, LONG_DESCRIPTION = DESCRIPTION.split('\n\n', 1)
else:
    LONG_DESCRIPTION = None

# Extract name and e-mail ("<NAME> <<EMAIL>>")
AUTHOR, EMAIL = re.match(r'(.*) <(.*)>', AUTHOR_EMAIL).groups()

setup(name=PACKAGE,
      version=VERSION,
      description=DESCRIPTION,
      long_description=LONG_DESCRIPTION,
      author=AUTHOR,
      author_email=EMAIL,
      license=LICENSE,
      url=WEBSITE,
      packages=PACKAGES,
      scripts=SCRIPTS,
      download_url=WEBSITE+PACKAGE+'-'+VERSION+'.tar.gz',
      package_data = {
        'feedservice.pubsubhubbub': ['_design/*/*/*'],
        'feedservice.urlstore': ['_design/*/*/*'],
        'feedservice.parse': ['templates/*.html'],
      },
)


{'fraction_non_alphanumeric': 0.15756783262504087, 'fraction_numerical': 0.0013076168682576005, 'mean_word_length': 4.0578512396694215, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 0, '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': '2687816', 'n_tokens_mistral': 1063, 'n_tokens_neox': 1031, 'n_words': 210}