import os
from setuptools import setup, find_packages

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

# Can't use "from hamcrest import __version__" on Python 3. (SyntaxError)
# use dirty hack
import re
matched = re.match('__version__.*', read(os.path.join('hamcrest', '__init__.py')))
if matched:
    exec(matched.group())

setup(
    name = 'PyHamcrest',
    version = __version__,
    author = 'Jon Reid',
    author_email = 'jon.reid@mac.com',
    description = 'Hamcrest framework for matcher objects',
    license = 'New BSD',
    platforms=['All'],
    keywords = 'hamcrest matchers pyunit unit test testing unittest unittesting',
    url = 'http://code.google.com/p/hamcrest/',
    download_url = 'http://pypi.python.org/packages/source/P/PyHamcrest/PyHamcrest-%s.tar.gz' % __version__,
    packages = find_packages(exclude=['hamcrest-unit-test', 'hamcrest-unit-test.*']),
    test_suite = 'hamcrest-unit-test.alltests',
    provides = ['hamcrest'],
    long_description=read('README.md'),
    classifiers = [
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 2.6',
        'Topic :: Software Development',
        'Topic :: Software Development :: Quality Assurance',
        'Topic :: Software Development :: Testing',
        ],
    use_2to3 = True,
    )

@@ -1,17 +1,38 @@
 import 
-o
 s
+ys%0Aimport os%0Aimport re
 %0Afrom se
@@ -249,26 +249,16 @@
 ty hack%0A
-import re%0A
 matched 
@@ -371,16 +371,86 @@
 oup())%0A%0A
+extra = %7B%7D%0Aif sys.version_info %3E= (3,):%0A    extra%5B'use_2to3'%5D = True%0A%0A
 setup(%0A 
@@ -1624,24 +1624,15 @@
     
-use_2to3 = True,
+**extra
 %0A   

Remove setuptools warning