def get_release_from_binary(cls, binary): try: pex_info = PexInfo.from_pex(PythonDirectoryWrapper.get(binary)) return cls.get_release_from_tag( pex_info.build_properties.get('tag', '')) except PythonDirectoryWrapper.Error: return 'UNKNOWN'
def __init__(self, path): if not os.path.exists(path): raise PythonLauncher.NotFound("Could not find python environment in %s" % path) self._dir = PythonDirectoryWrapper.get(path) try: self._manifest = json.loads(self._dir.read(PythonLauncher.MANIFEST)) except ValueError, e: raise PythonLauncher.InvalidFormat("Could not parse manifest! %s" % e)
def __init__(self, eggheads): """ eggheads = List of files or directories that end with ".egg" and point to valid eggs. Not intended to be called directly. Instead use the from_* factory methods. """ if not isinstance(eggheads, (types.ListType, types.TupleType)): raise ValueError("Expected eggs to be a list of filenames! Got %s" % type(eggheads)) self._eggs = {} for egg in eggheads: self._eggs[os.path.basename(egg)] = PythonDirectoryWrapper.get(egg)
def __init__(self, path): if not os.path.exists(path): raise PythonLauncher.NotFound("Could not find python environment in %s" % path) self._dir = PythonDirectoryWrapper.get(path) try: self._manifest = self._dir.read(PythonLauncher.MANIFEST) if Compatibility.PY3: self._manifest = str(self._manifest, encoding='utf8') self._manifest = json.loads(self._manifest) except ValueError as e: raise PythonLauncher.InvalidFormat("Could not parse manifest! %s" % e) self._cache = EggCache(self._dir) self._path = OrderedSet([os.path.abspath(path)])
def version(args): """usage: version Prints information about the version of the aurora client being run. """ try: pexpath = sys.argv[0] pex_info = PexInfo.from_pex(PythonDirectoryWrapper.get(pexpath)) print("Aurora client build info:") print("\tsha: %s" % pex_info.build_properties['sha']) print("\tdate: %s" % pex_info.build_properties['date']) except (IOError, PythonDirectoryWrapper.Error): print("Aurora client build info not available") print("Aurora API version: %s" % CURRENT_API_VERSION)
def get_release_from_binary(cls, binary): try: pex_info = PexInfo.from_pex(PythonDirectoryWrapper.get(binary)) return cls.get_release_from_tag(pex_info.build_properties.get('tag', '')) except PythonDirectoryWrapper.Error: return 'UNKNOWN'
def __init__(self, pex=sys.argv[0]): self._pex = PythonDirectoryWrapper.get(pex) self._pex_info = PexInfo.from_pex(self._pex) self._env = PEXEnvironment(self._pex.path(), self._pex_info)