#!/usr/bin/env python
# -*- coding: utf-8 -*-

from setuptools import setup, find_packages

# use requirements.txt for dependencies
with open('requirements.txt') as f:
    required = map(lambda s: s.strip(), f.readlines())

with open('README.md') as f:
    readme = f.read()

with open('LICENSE') as f:
    license = f.read()

setup(
    name='ronkyuu',
    version='0.2.11',
    description='Webmention Manager',
    long_description=readme,
    install_requires=required,
    author='Mike Taylor and Kartik Prabhu',
    author_email='bear@bear.im',
    url='https://github.com/bear/ronkyuu',
    license=license,
    packages=find_packages(exclude=('tests', 'docs'))
)

@@ -40,16 +40,51 @@
 -8 -*-%0A%0A
+import os%0Aimport re%0Aimport codecs%0A%0A
 from set
@@ -124,250 +124,633 @@
 es%0A%0A
-# use requirements.txt for dependencies%0Awith open('requirements.txt
+cwd = os.path.abspath(os.path.dirname(__file__))%0A%0Adef read(filename):%0A    with codecs.open(os.path.join(cwd, filename), 'rb', 'utf-8
 ') as 
-f
+h
 :%0A    
+   
+ 
 re
-quired = map(lambda s: s.strip(), f.readlines())%0A%0Awith open('README.md') as f:%0A    readme = f.read()%0A%0Awith open('LICENSE') as f:%0A    license = f.read()%0A%0A
+turn h.read()%0A%0Ametadata = read(os.path.join(cwd, 'ronkyuu', '__init__.py'))%0A%0Adef extract_metaitem(meta):%0A    # swiped from https://hynek.me 's attr package%0A    meta_match = re.search(r%22%22%22%5E__%7Bmeta%7D__%5Cs+=%5Cs+%5B'%5C%22%5D(%5B%5E'%5C%22%5D*)%5B'%5C%22%5D%22%22%22.format(meta=meta), %0A                           metadata, re.MULTILINE)%0A    if meta_match:%0A        return meta_match.group(1)%0A    raise RuntimeError('Unable to find __%7Bmeta%7D__ string.'.format(meta=meta))%0A%0Aif __name__ == '__main__':%0A    
 setup(%0A
+    
     
@@ -773,16 +773,20 @@
     
+ 
+   
 version=
 '0.2
@@ -785,309 +785,1190 @@
 ion=
-'0.2.11',%0A    description='Webmention Manager',%0A    long_description=readme,%0A    install_requires=required,%0A    author='Mike Taylor and Kartik Prabhu',%0A    author_email='bear@bear.im',%0A
+extract_metaitem('version'),%0A        description=extract_metaitem('description'),%0A        long_description=read('README.md'),%0A        author=extract_metaitem('author'),%0A        author_email=extract_metaitem('email'),%0A        maintainer=extract_metaitem('author'),%0A        maintainer_email=extract_metaitem('email'),%0A   
     
+ 
 url=
-'https://github.com/bear/ronkyuu',%0A    license=license,%0A    packages=find_packages(exclude=('tests', 'docs'))%0A
+extract_metaitem('url'),%0A        download_url=extract_metaitem('download_url'),%0A        license=extract_metaitem('license'),%0A        packages=find_packages(exclude=('tests', 'docs')),%0A        platforms=%5B'Any'%5D,%0A        classifiers=%5B%0A          'Development Status :: 4 - Beta',%0A          'Intended Audience :: Developers',%0A          'Operating System :: OS Independent',%0A          'License :: OSI Approved :: MIT License',%0A          'Programming Language :: Python',%0A          'Programming Language :: Python :: 2',%0A          'Programming Language :: Python :: 2.7',%0A          'Programming Language :: Python :: 3',%0A          'Programming Language :: Python :: 3.3',%0A          'Programming Language :: Python :: 3.4',%0A          'Programming Language :: Python :: 3.5',%0A          'Topic :: Software Development :: Libraries :: Python Modules',%0A        %5D%0A    
 )%0A

update setup.py to not import __init__ but rather to read and extract metadata. also read long text files with utf-8 enabled.