<s> import ast <EOL> import io <EOL> import os <EOL> import re <EOL> from setuptools import setup , find_packages <EOL> class VersionFinder ( ast . NodeVisitor ) : <EOL> def __init__ ( self ) : <EOL> self . version = None <EOL> def visit_Assign ( self , node ) : <EOL> if node . targets [ <NUM_LIT:0> ] . id == '<STR_LIT>' : <EOL> self . version = node . value . s <EOL> def read_version ( ) : <EOL> """<STR_LIT>""" <EOL> finder = VersionFinder ( ) <EOL> finder . visit ( <EOL> ast . parse ( local_file ( '<STR_LIT>' , '<STR_LIT>' ) . encode ( '<STR_LIT:utf-8>' ) ) ) <EOL> return finder . version <EOL> def parse_requirements ( path ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> requirements = [ req . strip ( ) for req in local_file ( path ) . splitlines ( ) ] <EOL> except IOError : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> links = [ ] <EOL> pkgs = [ ] <EOL> for req in requirements : <EOL> if not req : <EOL> continue <EOL> if '<STR_LIT>' in req or '<STR_LIT>' in req : <EOL> links . append ( req ) <EOL> name , version = re . findall ( "<STR_LIT>" , req ) [ <NUM_LIT:0> ] <EOL> pkgs . append ( '<STR_LIT>' . format ( name , version ) ) <EOL> else : <EOL> pkgs . append ( req ) <EOL> return pkgs , links <EOL> local_file = lambda * f : io . open ( <EOL> os . path . join ( os . path . dirname ( __file__ ) , * f ) , encoding = '<STR_LIT:utf-8>' ) . read ( ) <EOL> install_requires , dependency_links = parse_requirements ( '<STR_LIT>' ) <EOL> setup ( <EOL> name = '<STR_LIT>' , <EOL> version = read_version ( ) , <EOL> description = '<STR_LIT>' , <EOL> long_description = local_file ( '<STR_LIT>' ) , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> zip_safe = False , <EOL> packages = find_packages ( exclude = [ '<STR_LIT>' ] ) , <EOL> tests_require = parse_requirements ( '<STR_LIT>' ) , <EOL> install_requires = install_requires , <EOL> dependency_links = dependency_links , <EOL> license = '<STR_LIT>' , <EOL> test_suite = '<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> '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] , <EOL> ) </s>
