def setUp(self): self.environ0 = os.environ.copy() os.environ["EUPS_PATH"] = testEupsStack self.tablefile = os.path.join(testEupsStack, "tablesyntax.table") self.table = Table(self.tablefile) self.eups = Eups(flavor="Linux") for k in [ "EIGEN_DIR", ]: # we're going to assert that it isn't set try: del os.environ[k] except KeyError: pass
def loadTableFor(self, version, table=None): """ cache the parsed contents of the table file. If table is not None, it will be taken as the Table instance representing the already parsed contents; otherwise, the table will be loaded from the table file path. @param version the version of the product to load @param table an instance of Table to accept as the loaded contents """ try: verdata = self.versions[version] if not table: if not utils.isRealFilename(verdata[1]): return if not os.path.exists(verdata[1]): raise TableFileNotFound(verdata[1], self.name, version) prod = self.getProduct(version) table = Table(verdata[1]).expandEupsVariables(prod) self.versions[version] = (verdata[0], verdata[1], table) except KeyError: raise ProductNotFound(self.name, version)
def getManifest(self, product, version, flavor, noaction=False): if noaction: return Manifest() if version is None: raise RuntimeError("Unspecified version for %s" % product) tablefile = self.getTableFile(product, version, flavor) table = Table(tablefile) deps = table.dependencies(self.Eups, recursive=True) deps.reverse() manifest = Manifest(product, version) for p, optional, depth in deps: if not optional or self.Eups.findProduct(p.name, p.version): manifest.addDependency(p.name, p.version, p.flavor, None, None, None, optional) distId = "build:%s-%s.build" % (product, version) tableName = "%s.table" % product manifest.addDependency(product, version, flavor, tableName, os.path.join(product, version), distId, False) return manifest
def setUp(self): os.environ["EUPS_PATH"] = testEupsStack self.tablefile = os.path.join(testEupsStack, "externalProducts.table") self.table = Table(self.tablefile) self.eups = Eups()
def setUp(self): os.environ["EUPS_PATH"] = testEupsStack self.tablefile = os.path.join(testEupsStack, "eupsVersion.table") self.table = Table(self.tablefile) self.eups = Eups()
def setUp(self): os.environ["EUPS_PATH"] = testEupsStack self.tablefile = os.path.join(testEupsStack, "mwi.table") self.table = Table(self.tablefile)