<s> import os <EOL> import sys <EOL> from setuptools import setup , Extension , Command <EOL> from distutils . command . build_ext import build_ext <EOL> from distutils . errors import ( CCompilerError , DistutilsExecError , DistutilsPlatformError ) <EOL> if sys . platform == '<STR_LIT:win32>' and sys . version_info > ( <NUM_LIT:2> , <NUM_LIT:6> ) : <EOL> ext_errors = ( CCompilerError , DistutilsExecError , DistutilsPlatformError , <EOL> IOError , ValueError ) <EOL> else : <EOL> ext_errors = ( CCompilerError , DistutilsExecError , DistutilsPlatformError ) <EOL> IS_PYPY = hasattr ( sys , '<STR_LIT>' ) <EOL> class BuildFailed ( Exception ) : <EOL> pass <EOL> class ve_build_ext ( build_ext ) : <EOL> def run ( self ) : <EOL> try : <EOL> build_ext . run ( self ) <EOL> except DistutilsPlatformError : <EOL> raise BuildFailed ( ) <EOL> def build_extension ( self , ext ) : <EOL> try : <EOL> build_ext . build_extension ( self , ext ) <EOL> except ext_errors : <EOL> raise BuildFailed ( ) <EOL> class TestCommand ( Command ) : <EOL> """<STR_LIT>""" <EOL> user_options = [ ( "<STR_LIT>" , None , '''<STR_LIT>''' ) ] <EOL> def initialize_options ( self ) : <EOL> self . args = '<STR_LIT>' <EOL> pass <EOL> def finalize_options ( self ) : <EOL> pass <EOL> def run ( self ) : <EOL> self . run_command ( '<STR_LIT>' ) <EOL> bld = self . distribution . get_command_obj ( '<STR_LIT>' ) <EOL> sys . path = [ os . path . abspath ( bld . build_lib ) ] + sys . path <EOL> import shlex <EOL> import unittest <EOL> test_argv0 = [ sys . argv [ <NUM_LIT:0> ] + '<STR_LIT>' ] <EOL> test_argv = test_argv0 + shlex . split ( self . args ) <EOL> unittest . main ( module = '<STR_LIT>' , argv = test_argv ) <EOL> def run_setup ( build_c ) : <EOL> kw = { } <EOL> if build_c : <EOL> kw = dict ( <EOL> ext_modules = [ Extension ( "<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> '<STR_LIT>' , <EOL> '<STR_LIT>' ] , <EOL> define_macros = [ ( '<STR_LIT>' , '<STR_LIT:1>' ) ] , <EOL> ) ] , <EOL> cmdclass = dict ( build_ext = ve_build_ext , test = TestCommand ) , <EOL> packages = [ '<STR_LIT>' ] , <EOL> ) <EOL> else : <EOL> kw = dict ( cmdclass = dict ( test = TestCommand ) , packages = [ '<STR_LIT>' ] ) <EOL> with open ( '<STR_LIT>' ) as readme : <EOL> long_description = readme . read ( ) <EOL> setup ( name = "<STR_LIT>" , <EOL> version = "<STR_LIT>" , <EOL> platforms = [ "<STR_LIT>" ] , <EOL> description = ( "<STR_LIT>" <EOL> "<STR_LIT>" ) , <EOL> url = "<STR_LIT>" , <EOL> long_description = long_description , <EOL> classifiers = [ "<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> ** kw ) <EOL> try : <EOL> run_setup ( not IS_PYPY ) <EOL> except BuildFailed : <EOL> print ( '<STR_LIT:*>' * <NUM_LIT> ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT:*>' * <NUM_LIT> ) <EOL> run_setup ( False ) <EOL> print ( '<STR_LIT:*>' * <NUM_LIT> ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT:*>' * <NUM_LIT> ) </s>
