<s> """<STR_LIT>""" <EOL> import os . path <EOL> import posixpath <EOL> import shutil <EOL> import subprocess <EOL> from distutils import log <EOL> from distutils . version import StrictVersion <EOL> import setuptools . command . build_py <EOL> import setuptools . command . build_ext <EOL> import setuptools <EOL> __requires__ = '<STR_LIT>' <EOL> assert StrictVersion ( setuptools . __version__ ) >= StrictVersion ( '<STR_LIT>' ) , '<STR_LIT>' <EOL> SETUP_DIR = os . path . dirname ( __file__ ) <EOL> class build_meteor ( setuptools . command . build_py . build_py ) : <EOL> """<STR_LIT>""" <EOL> user_options = [ <EOL> ( '<STR_LIT>' , None , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , None , '<STR_LIT>' ) , <EOL> ( '<STR_LIT>' , None , "<STR_LIT>" ) , <EOL> ( '<STR_LIT>' , '<STR_LIT:d>' , '<STR_LIT>' ) , <EOL> ] <EOL> negative_opt = [ ] <EOL> meteor = None <EOL> meteor_debug = None <EOL> build_lib = None <EOL> package_dir = None <EOL> meteor_builds = None <EOL> no_prune_npm = None <EOL> inplace = None <EOL> def initialize_options ( self ) : <EOL> """<STR_LIT>""" <EOL> setuptools . command . build_py . build_py . initialize_options ( self ) <EOL> self . meteor = '<STR_LIT>' <EOL> self . meteor_debug = False <EOL> self . build_lib = None <EOL> self . package_dir = None <EOL> self . meteor_builds = [ ] <EOL> self . no_prune_npm = None <EOL> self . inplace = True <EOL> def finalize_options ( self ) : <EOL> """<STR_LIT>""" <EOL> self . set_undefined_options ( <EOL> '<STR_LIT>' , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> self . set_undefined_options ( <EOL> '<STR_LIT>' , <EOL> ( '<STR_LIT>' , '<STR_LIT>' ) , <EOL> ) <EOL> setuptools . command . build_py . build_py . finalize_options ( self ) <EOL> @ staticmethod <EOL> def has_meteor_builds ( distribution ) : <EOL> """<STR_LIT>""" <EOL> return bool ( <EOL> distribution . command_options [ '<STR_LIT>' ] [ '<STR_LIT>' ] <EOL> ) <EOL> def get_package_dir ( self , package ) : <EOL> res = setuptools . command . build_py . orig . build_py . get_package_dir ( <EOL> self , package , <EOL> ) <EOL> if self . distribution . src_root is not None : <EOL> return os . path . join ( self . distribution . src_root , res ) <EOL> return res <EOL> def run ( self ) : <EOL> """<STR_LIT>""" <EOL> for ( package , source , target , extra_args ) in self . meteor_builds : <EOL> src_dir = self . get_package_dir ( package ) <EOL> project_dir = self . path_to_dir ( src_dir , source ) <EOL> target_dir = self . path_to_dir ( src_dir , target ) <EOL> output_dir = self . path_to_dir ( <EOL> os . path . abspath ( SETUP_DIR if self . inplace else self . build_lib ) , <EOL> target_dir , <EOL> ) <EOL> cmdline = [ self . meteor , '<STR_LIT>' , '<STR_LIT>' , output_dir ] <EOL> no_prune_npm = self . no_prune_npm <EOL> if extra_args [ : <NUM_LIT:1> ] == [ '<STR_LIT>' ] : <EOL> no_prune_npm = True <EOL> extra_args [ : <NUM_LIT:1> ] = [ ] <EOL> if self . meteor_debug and '<STR_LIT>' not in cmdline : <EOL> cmdline . append ( '<STR_LIT>' ) <EOL> cmdline . extend ( extra_args ) <EOL> log . info ( <EOL> '<STR_LIT>' , project_dir , '<STR_LIT:U+0020>' . join ( cmdline ) , <EOL> ) <EOL> subprocess . check_call ( cmdline , cwd = project_dir ) <EOL> if not no_prune_npm : <EOL> npm_build_dir = os . path . join ( <EOL> output_dir , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> ) <EOL> log . info ( '<STR_LIT>' , npm_build_dir ) <EOL> shutil . rmtree ( npm_build_dir ) <EOL> @ staticmethod <EOL> def path_to_dir ( * path_args ) : <EOL> """<STR_LIT>""" <EOL> return os . path . join ( <EOL> * list ( path_args [ : - <NUM_LIT:1> ] ) + path_args [ - <NUM_LIT:1> ] . split ( posixpath . sep ) <EOL> ) <EOL> class build_ext ( setuptools . command . build_ext . build_ext ) : <EOL> def run ( self ) : <EOL> if build_meteor . has_meteor_builds ( self . distribution ) : <EOL> self . reinitialize_command ( '<STR_LIT>' , inplace = True ) <EOL> self . run_command ( '<STR_LIT>' ) <EOL> return setuptools . command . build_ext . build_ext . run ( self ) <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> "<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> "<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> setuptools . setup ( <EOL> name = '<STR_LIT>' , <EOL> version = '<STR_LIT>' , <EOL> description = __doc__ , <EOL> long_description = open ( '<STR_LIT>' ) . read ( ) , <EOL> author = '<STR_LIT>' , <EOL> author_email = '<STR_LIT>' , <EOL> url = '<STR_LIT>' , <EOL> keywords = [ <EOL> '<STR_LIT>' <EOL> '<STR_LIT>' <EOL> ] , <EOL> license = '<STR_LIT>' , <EOL> packages = setuptools . find_packages ( exclude = [ '<STR_LIT>' ] ) , <EOL> include_package_data = True , <EOL> zip_safe = True , <EOL> setup_requires = [ <EOL> __requires__ , <EOL> ] , <EOL> install_requires = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> extras_require = { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> } , <EOL> entry_points = { <EOL> '<STR_LIT>' : [ <EOL> '<STR_LIT>' , <EOL> ] , <EOL> } , <EOL> classifiers = CLASSIFIERS , <EOL> test_suite = '<STR_LIT>' , <EOL> tests_require = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] , <EOL> cmdclass = { <EOL> '<STR_LIT>' : build_ext , <EOL> '<STR_LIT>' : build_meteor , <EOL> } , <EOL> options = { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT:1>' , <EOL> } , <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : [ <EOL> ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , [ ] ) , <EOL> ] , <EOL> } , <EOL> } , <EOL> ) </s>
