def create_conda_envs(self, dryrun=False, forceall=False, init_only=False, quiet=False):
    jobs = (self.jobs if forceall else self.needrun_jobs)
    env_set = {(job.conda_env_file, job.container_img_url) for job in jobs if job.conda_env_file}
    self.conda_envs = dict()
    for (env_file, simg_url) in env_set:
        simg = None
        if (simg_url and self.workflow.use_singularity):
            assert (simg_url in self.container_imgs), 'bug: must first pull singularity images'
            simg = self.container_imgs[simg_url]
        env = conda.Env(env_file, self, container_img=simg, cleanup=self.workflow.conda_cleanup_pkgs)
        self.conda_envs[(env_file, simg_url)] = env
    if (not init_only):
        for env in self.conda_envs.values():
            if ((not dryrun) or (not quiet)):
                env.create(dryrun)
def create_conda_envs(self, dryrun=False, forceall=False, init_only=False, quiet=False):
    jobs = (self.jobs if forceall else self.needrun_jobs)
    env_set = {(job.conda_env_file, job.container_img_url) for job in jobs if job.conda_env_file}
    self.conda_envs = dict()
    for (env_file, simg_url) in env_set:
        simg = None
        if (simg_url and self.workflow.use_singularity):
            assert (simg_url in self.container_imgs), 'bug: must first pull singularity images'
            simg = self.container_imgs[simg_url]
        env = conda.Env(env_file, self, container_img=simg, cleanup=self.workflow.conda_cleanup_pkgs)
        self.conda_envs[(env_file, simg_url)] = env
    if (not init_only):
        for env in self.conda_envs.values():
            if ((not dryrun) or (not quiet)):
                env.create(dryrun)