<s> import io <EOL> import os <EOL> import re <EOL> import sys <EOL> import subprocess <EOL> PACKAGE_NAME = '<STR_LIT>' <EOL> DESCRIPTION = "<STR_LIT>" <EOL> LONG_DESCRIPTION = DESCRIPTION <EOL> AUTHOR = "<STR_LIT>" <EOL> AUTHOR_EMAIL = "<STR_LIT>" <EOL> URL = '<STR_LIT>' <EOL> DOWNLOAD_URL = '<STR_LIT>' <EOL> LICENSE = '<STR_LIT>' <EOL> def version ( package , encoding = '<STR_LIT:utf-8>' ) : <EOL> """<STR_LIT>""" <EOL> path = os . path . join ( os . path . dirname ( __file__ ) , package , '<STR_LIT>' ) <EOL> with io . open ( path , encoding = encoding ) as fp : <EOL> version_info = fp . read ( ) <EOL> version_match = re . search ( r"""<STR_LIT>""" , <EOL> version_info , re . M ) <EOL> if not version_match : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> return version_match . group ( <NUM_LIT:1> ) <EOL> def generate_cython ( package ) : <EOL> """<STR_LIT>""" <EOL> cwd = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> print ( "<STR_LIT>" ) <EOL> p = subprocess . call ( [ sys . executable , <EOL> os . path . join ( cwd , '<STR_LIT>' , '<STR_LIT>' ) , <EOL> package ] , <EOL> cwd = cwd ) <EOL> if p != <NUM_LIT:0> : <EOL> raise RuntimeError ( "<STR_LIT>" ) <EOL> def configuration ( parent_package = '<STR_LIT>' , top_path = None ) : <EOL> from numpy . distutils . misc_util import Configuration <EOL> config = Configuration ( None , parent_package , top_path ) <EOL> config . set_options ( ignore_setup_xxx_py = True , <EOL> assume_default_configuration = True , <EOL> delegate_options_to_subpackages = True , <EOL> quiet = True ) <EOL> config . add_subpackage ( PACKAGE_NAME ) <EOL> return config <EOL> def setup_package ( ) : <EOL> from numpy . distutils . core import setup <EOL> old_path = os . getcwd ( ) <EOL> local_path = os . path . dirname ( os . path . abspath ( sys . argv [ <NUM_LIT:0> ] ) ) <EOL> src_path = local_path <EOL> os . chdir ( local_path ) <EOL> sys . path . insert ( <NUM_LIT:0> , local_path ) <EOL> old_path = os . getcwd ( ) <EOL> os . chdir ( src_path ) <EOL> sys . path . insert ( <NUM_LIT:0> , src_path ) <EOL> cwd = os . path . abspath ( os . path . dirname ( __file__ ) ) <EOL> if not os . path . exists ( os . path . join ( cwd , '<STR_LIT>' ) ) : <EOL> generate_cython ( PACKAGE_NAME ) <EOL> try : <EOL> setup ( name = PACKAGE_NAME , <EOL> author = AUTHOR , <EOL> author_email = AUTHOR_EMAIL , <EOL> url = URL , <EOL> download_url = DOWNLOAD_URL , <EOL> description = DESCRIPTION , <EOL> long_description = LONG_DESCRIPTION , <EOL> version = version ( PACKAGE_NAME ) , <EOL> license = LICENSE , <EOL> configuration = configuration , <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> finally : <EOL> del sys . path [ <NUM_LIT:0> ] <EOL> os . chdir ( old_path ) <EOL> return <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> setup_package ( ) </s>
