<s> from __future__ import unicode_literals <EOL> import sys <EOL> import re <EOL> from setuptools import setup , find_packages <EOL> from setuptools . command . test import test as TestCommand <EOL> class PyTest ( TestCommand ) : <EOL> def finalize_options ( self ) : <EOL> TestCommand . finalize_options ( self ) <EOL> self . test_args = [ ] <EOL> self . test_suite = True <EOL> def run_tests ( self ) : <EOL> import pytest <EOL> errno = pytest . main ( self . test_args ) <EOL> sys . exit ( errno ) <EOL> def is_requirement ( line ) : <EOL> line = line . strip ( ) <EOL> return not ( <EOL> line == '<STR_LIT>' or <EOL> line . startswith ( '<STR_LIT>' ) or <EOL> line . startswith ( '<STR_LIT>' ) or <EOL> line . startswith ( '<STR_LIT:#>' ) or <EOL> line . startswith ( '<STR_LIT>' ) or <EOL> line . startswith ( '<STR_LIT>' ) <EOL> ) <EOL> def get_requirements ( path ) : <EOL> with open ( path ) as f : <EOL> lines = f . readlines ( ) <EOL> return [ l . strip ( ) for l in lines if is_requirement ( l ) ] <EOL> version = '<STR_LIT>' <EOL> with open ( '<STR_LIT>' , '<STR_LIT:r>' ) as fd : <EOL> version = re . search ( r'<STR_LIT>' , <EOL> fd . read ( ) , re . MULTILINE ) . group ( <NUM_LIT:1> ) <EOL> if not version : <EOL> raise RuntimeError ( '<STR_LIT>' ) <EOL> setup ( <EOL> name = "<STR_LIT>" , <EOL> version = version , <EOL> description = "<STR_LIT>" , <EOL> long_description = open ( '<STR_LIT>' ) . read ( ) , <EOL> author = "<STR_LIT>" , <EOL> author_email = "<STR_LIT>" , <EOL> url = "<STR_LIT>" , <EOL> packages = find_packages ( ) , <EOL> install_requires = get_requirements ( "<STR_LIT>" ) , <EOL> tests_require = get_requirements ( "<STR_LIT>" ) , <EOL> extras_require = { <EOL> '<STR_LIT>' : [ '<STR_LIT>' , '<STR_LIT>' ] , <EOL> '<STR_LIT>' : [ '<STR_LIT>' ] , <EOL> } , <EOL> cmdclass = { '<STR_LIT:test>' : PyTest } , <EOL> license = '<STR_LIT>' , <EOL> classifiers = ( <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ) , <EOL> zip_safe = False , <EOL> ) </s>
