Example #1
0
    def __init__(self, config):
        """
        Initialize the binary distribution manager.

        :param config: The pip-accel configuration (a :class:`.Config`
                       object).
        """
        self.config = config
        self.cache = CacheManager(config)
        self.system_package_manager = SystemPackageManager(config)
Example #2
0
 def test_system_package_dependency_failures(self):
     this_script = os.path.abspath(__file__)
     pip_accel_directory = os.path.dirname(this_script)
     deps_directory = os.path.join(pip_accel_directory, 'deps')
     dummy_deps_config = os.path.join(deps_directory, 'unsupported-platform-test.ini')
     # Create an unsupported system package manager configuration.
     with open(dummy_deps_config, 'w') as handle:
         handle.write('[commands]\n')
         handle.write('supported = false\n')
         handle.write('list = false\n')
         handle.write('installed = false\n')
     try:
         # Validate that the unsupported configuration is ignored (gracefully).
         manager = SystemPackageManager(Config())
         assert manager.list_command != 'false' and manager.install_command != 'false', \
             "System package manager seems to have activated an unsupported configuration!"
     finally:
         # Never leave the dummy configuration file behind.
         os.remove(dummy_deps_config)