#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import re
import sys

from setuptools import setup, find_packages


# Stealing this from Kenneth Reitz
if sys.argv[-1] == 'publish':
    os.system('python setup.py sdist upload')
    sys.exit()

setup(
    name='pycohttpparser',
    version='1.0.0',
    description='Python wrapper for picohttpparser',
    long_description=open('README.rst').read() + '\r\n' + open('HISTORY.rst').read(),
    author='Cory Benfield',
    author_email='cory@lukasa.co.uk',
    url='https://github.com/Lukasa/pycohttpparser',
    packages=find_packages('src'),
    package_dir={'': 'src'},
    license='MIT License',
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python',
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.4',
    ],
    install_requires=['cffi>=1.0.0'],
    setup_requires=['cffi>=1.0.0'],
    zip_safe=False,
    cffi_modules=["src/pycohttpparser/build.py:ffi"],
    ext_package="pycohttpparser",
)

@@ -117,16 +117,319 @@
 kages%0A%0A%0A
+# Get the version%0Aversion_regex = r'__version__ = %5B%22%5C'%5D(%5B%5E%22%5C'%5D*)%5B%22%5C'%5D'%0Awith open('src/pycohttpparser/__init__.py', 'r') as f:%0A    text = f.read()%0A    match = re.search(version_regex, text)%0A%0A    if match:%0A        version = match.group(1)%0A    else:%0A        raise RuntimeError(%22No version number found!%22)%0A%0A
 # Steali
@@ -455,16 +455,16 @@
 h Reitz%0A
-
 if sys.a
@@ -597,15 +597,15 @@
 ion=
-'1.0.0'
+version
 ,%0A  

Revert "Stop reaching in for the version."