#!/usr/bin/env python
#

import os.path

import setuptools

from sprockets import http


def read_requirements(filename):
    requirements = []
    try:
        with open(os.path.join('requires', filename)) as req_file:
            for line in req_file:
                if '#' in line:
                    line = line[:line.index('#')]
                line = line.strip()
                if line.startswith('-'):
                    pass
                requirements.append(line)
    except IOError:
        pass
    return requirements


requirements = read_requirements('installation.txt')
tests_require = read_requirements('testing.txt')

setuptools.setup(
    name='sprockets.http',
    version=http.__version__,
    description='Tornado HTTP application runner',
    author='AWeber Communications',
    author_email='api@aweber.com',
    url='https://github.com/sprockets/sprockets.http',
    install_requires=requirements,
    license='BSD',
    namespace_packages=['sprockets'],
    packages=setuptools.find_packages(),
    entry_points={
        'distutils.commands': ['httprun=sprockets.http.runner:RunCommand'],
    },
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: No Input/Output (Daemon)',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Natural Language :: English',
        'Operating System :: OS Independent',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: Implementation :: CPython',
        'Topic :: Internet :: WWW/HTTP',
        'Topic :: Software Development :: Libraries',
        'Topic :: Software Development :: Libraries :: Python Modules'],
    test_suite='nose.collector',
    tests_require=tests_require,
    python_requires='>=3.5',
    zip_safe=True,
)

@@ -25,23 +25,23 @@
 %0Aimport 
-os.
 path
+lib
 %0A%0Aimport
@@ -104,20 +104,16 @@
 rements(
-file
 name):%0A 
@@ -141,43 +141,32 @@
     
-try:%0A        with open(os.path.join
+for line in pathlib.Path
 ('re
@@ -178,78 +178,47 @@
 s', 
-file
 name)
-) as req_file:%0A            for line in req_file:%0A    
+.read_text().split('%5Cn'):%0A
         
     
@@ -213,20 +213,16 @@
         
-    
 if '#' i
@@ -229,24 +229,16 @@
 n line:%0A
-        
         
@@ -275,32 +275,24 @@
 ')%5D%0A        
-      
-  
 line = line.
@@ -307,24 +307,16 @@
         
-       
- 
 if line.
@@ -332,24 +332,16 @@
 h('-'):%0A
-        
         
@@ -349,24 +349,16 @@
    pass%0A
-        
         
@@ -391,164 +391,28 @@
     
-except IOError:%0A        pass%0A    return requirements%0A%0A%0Arequirements = read_requirements('installation.txt')%0Atests_require = read_requirements('testing.txt')
+return requirements%0A
 %0A%0Ase
@@ -682,16 +682,21 @@
 equires=
+read_
 requirem
@@ -699,16 +699,36 @@
 irements
+('installation.txt')
 ,%0A    li
@@ -1707,29 +1707,28 @@
 require=
-tests
+read
 _require
 ,%0A    py
@@ -1719,16 +1719,36 @@
 _require
+ments('testing.txt')
 ,%0A    py

Simplify setup.py