#!/usr/bin/env python
import re
from distutils.core import Command, setup

__version__ = re.search(r"^__version__ = '(.*)'",
                        open('gevent_inotifyx.py', 'r').read(),
                        re.M).group(1)

class TestCommand(Command):
    """Custom distutils command to run the test suite."""
    user_options = []

    def initialize_options(self):
        pass

    def finalize_options(self):
        pass

    def run(self):
        import unittest
        import test_gevent_inotifyx
        suite = unittest.TestLoader().loadTestsFromModule(test_gevent_inotifyx)
        unittest.TextTestRunner(verbosity=2).run(suite)

setup(name='gevent_inotifyx',
      version=__version__,
      description='gevent compatibility for inotifyx',
      author='Stanis Trendelenburg',
      author_email='stanis.trendelenburg@gmail.com',
      url='https://github.com/trendels/gevent_inotifyx',
      license='MIT',
      py_modules=['gevent_inotifyx'],
      cmdclass = {'test': TestCommand},
      install_requires=['gevent', 'inotifyx'],
)

@@ -34,616 +34,144 @@
 rom 
-distutils.core import Command, setup%0A%0A__version__ = re.search(r%22%5E__version__ = '(.*)'%22,%0A                        open('gevent_inotifyx.py', 'r').read(),%0A                        re.M).group(1)%0A%0Aclass TestCommand(Command):%0A    %22%22%22Custom distutils command to run the test suite.%22%22%22%0A    user_options = %5B%5D%0A%0A    def initialize_options(self):%0A        pass%0A%0A    def finalize_options(self):%0A        pass%0A%0A    def run(self):%0A        import unittest%0A        import test_gevent_inotifyx%0A        suite = unittest.TestLoader().loadTestsFromModule(test_gevent_inotifyx)%0A        unittest.TextTestRunner(verbosity=2).run(suite
+setuptools import setup%0A%0Awith open('gevent_inotifyx.py') as f:%0A    version = re.search(r%22%5E__version__ = '(.*)'%22, f.read(), re.M).group(1
 )%0A%0As
@@ -175,16 +175,21 @@
 %0A%0Asetup(
+%0A    
 name='ge
@@ -212,18 +212,16 @@
     
-  
 version=
 __ve
@@ -220,23 +220,17 @@
 ion=
-__
 version
-__,%0A  
+,%0A
     
@@ -278,26 +278,24 @@
 tifyx',%0A    
-  
 author='Stan
@@ -313,18 +313,16 @@
 nburg',%0A
-  
     auth
@@ -368,18 +368,16 @@
 m',%0A    
- 
- 
 url='htt
@@ -423,18 +423,16 @@
 x',%0A    
-  
 license=
@@ -438,18 +438,16 @@
 ='MIT',%0A
-  
     py_m
@@ -478,50 +478,8 @@
 '%5D,%0A
-      cmdclass = %7B'test': TestCommand%7D,%0A  
     

Clean up setup.py