Ejemplo n.º 1
0
 def __init__(self, options):
     self.options = options
     self.version = None
     self.errors = False
     self.environ = {}
     self.patches = {}
     if options is not None:
         if 'errors' in options:
             self.errors = options['errors'].as_bool()
         if 'version' in options:
             self.version = options['version'].as_str()
         if 'environ' in options:
             configuration = options.configuration
             for package in options['environ'].as_list():
                 self.environ[package] = configuration[
                     'setuptools_environ:' + package].as_dict()
         if 'patch' in options:
             available, version = have_cmd('patch', '--version')
             configuration = options.configuration
             if not available:
                 raise InstallationError(
                     u'Using patches in setuptools, '
                     u'but no patch command is available.')
             for package in options['patch'].as_list():
                 files = []
                 for option in configuration['setuptools_patch:' + package]:
                     files.extend(option.as_files())
                 self.patches[package] = files
Ejemplo n.º 2
0
 def __init__(self, path, readonly=False):
     assert path is not None
     if readonly and path == sys.executable:
         self._path = sys.executable
         self._platform = distutils.util.get_platform()
         self._python_path = sys.path
         self._version = ".".join(map(str, sys.version_info[:2]))
     else:
         have_python, version = have_cmd(
             path, '-c',
             'print "version", '
             '".".join(map(str, __import__("sys").version_info[:2]))')
         if not have_python:
             raise InstallationError(
                 "This configuration requires a specific Python "
                 "you don't have:",
                 path)
         self._version = version
         self._path = get_cmd_output(
             path, "-c",
             "print __import__('sys').executable")[0].strip()
         self._platform = None
         self._python_path = None
     self._setuptools = {}
     self._lock = threading.RLock()
Ejemplo n.º 3
0
 def __init__(self):
     self.available, self.version = have_cmd('svn', '--version')
     if isinstance(self.version, str):
         logger.info(u'Found Subversion version %s' % self.version)
     self.options = ['--non-interactive']
     if self.version > '1.6':
         self.options.append('--trust-server-cert')
Ejemplo n.º 4
0
 def __init__(self):
     self.available, self.version = have_cmd('git', '--version')
     if isinstance(self.version, str):
         logger.info('Found Git version %s' % self.version)
Ejemplo n.º 5
0
 def __init__(self):
     self.available, self.version = have_cmd("hg", "--version")
     if isinstance(self.version, str):
         logger.info("Found Mercurial version %s" % self.version)