#NEWLINE# def install_requirements( self , requirements , **kw ) : #NEWLINE# #INDENT# '\n        Manually install a requirement set from binary and/or wheel distributions.\n\n        :param requirements: A list of :class:`pip_accel.req.Requirement` objects.\n        :param kw: Any keyword arguments are passed on to\n                   :func:`~pip_accel.bdist.BinaryDistributionManager.install_binary_dist()`.\n        :returns: The number of packages that were just installed (an integer).\n        ' #NEWLINE# install_timer = Timer ( ) #NEWLINE# install_types = [ ] #NEWLINE# if any ( ( ( not req . is_wheel ) for req in requirements ) ) : #NEWLINE# #INDENT# install_types . append ( 'binary' ) #NEWLINE# #UNINDENT# if any ( ( req . is_wheel for req in requirements ) ) : #NEWLINE# #INDENT# install_types . append ( 'wheel' ) #NEWLINE# #UNINDENT# logger . info ( 'Installing from %s distributions ..' , concatenate ( install_types ) ) #NEWLINE# kw . setdefault ( 'track_installed_files' , True ) #NEWLINE# num_installed = 0 #NEWLINE# for requirement in requirements : #NEWLINE# #INDENT# if ( ( requirement . name == 'setuptools' ) and is_installed ( 'distribute' ) ) : #NEWLINE# #INDENT# uninstall ( 'distribute' ) #NEWLINE# #UNINDENT# if requirement . is_editable : #NEWLINE# #INDENT# logger . debug ( 'Installing %s in editable form using pip.' , requirement ) #NEWLINE# with TransactionalUpdate ( requirement ) : #NEWLINE# #INDENT# command = InstallCommand ( ) #NEWLINE# ( opts , args ) = command . parse_args ( [ '--no-deps' , '--editable' , requirement . source_directory ] ) #NEWLINE# command . run ( opts , args ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if requirement . is_wheel : #NEWLINE# #INDENT# logger . info ( 'Installing %s wheel distribution using pip ..' , requirement ) #NEWLINE# with TransactionalUpdate ( requirement ) : #NEWLINE# #INDENT# wheel_version = pip_wheel_module . wheel_version ( requirement . source_directory ) #NEWLINE# pip_wheel_module . check_compatibility ( wheel_version , requirement . name ) #NEWLINE# requirement . pip_requirement . move_wheel_files ( requirement . source_directory ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# logger . info ( 'Installing %s binary distribution using pip-accel ..' , requirement ) #NEWLINE# with TransactionalUpdate ( requirement ) : #NEWLINE# #INDENT# binary_distribution = self . bdists . get_binary_dist ( requirement ) #NEWLINE# self . bdists . install_binary_dist ( binary_distribution , ** kw ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# num_installed += 1 #NEWLINE# #UNINDENT# logger . info ( 'Finished installing %s in %s.' , pluralize ( requirement , 'requirement' ) , install_timer ) #NEWLINE# return num_installed