Skip to content

Commit e7c9379

Browse files
committed
Fix mamba env create stalls at prompt [ci fast]
Signed-off-by: Paolo Di Tommaso <[email protected]>
1 parent fa79c12 commit e7c9379

File tree

2 files changed

+3
-15
lines changed

2 files changed

+3
-15
lines changed

modules/nextflow/src/main/groovy/nextflow/conda/CondaCache.groovy

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import java.nio.file.Path
2222
import java.nio.file.Paths
2323
import java.util.concurrent.ConcurrentHashMap
2424

25-
import com.google.common.hash.Hashing
2625
import groovy.transform.CompileStatic
2726
import groovy.transform.PackageScope
2827
import groovy.util.logging.Slf4j
@@ -281,7 +280,7 @@ class CondaCache {
281280
def cmd
282281
if( isYamlFilePath(condaEnv) ) {
283282
final target = isYamlUriPath(condaEnv) ? condaEnv : Escape.path(makeAbsolute(condaEnv))
284-
final yesOpt = binaryName == 'micromamba' ? '--yes ' : ''
283+
final yesOpt = binaryName=="mamba" || binaryName == "micromamba" ? '--yes ' : ''
285284
cmd = "${binaryName} env create ${yesOpt}--prefix ${Escape.path(prefixPath)} --file ${target}"
286285
}
287286
else if( isTextFilePath(condaEnv) ) {

modules/nextflow/src/test/groovy/nextflow/conda/CondaCacheTest.groovy

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -181,12 +181,9 @@ class CondaCacheTest extends Specification {
181181

182182
cleanup:
183183
folder?.deleteDir()
184-
185184
}
186185

187-
188186
def 'should create a conda environment' () {
189-
190187
given:
191188
def ENV = 'bwa=1.1.1'
192189
def PREFIX = Files.createTempDirectory('foo')
@@ -208,11 +205,9 @@ class CondaCacheTest extends Specification {
208205
0 * cache.makeAbsolute(_)
209206
1 * cache.runCommand( "conda create --yes --quiet --prefix $PREFIX $ENV" ) >> null
210207
result == PREFIX
211-
212208
}
213209

214210
def 'should create a conda environment - using mamba' () {
215-
216211
given:
217212
def ENV = 'bwa=1.1.1'
218213
def PREFIX = Files.createTempDirectory('foo')
@@ -234,11 +229,9 @@ class CondaCacheTest extends Specification {
234229
0 * cache.makeAbsolute(_)
235230
1 * cache.runCommand("mamba create --yes --quiet --prefix $PREFIX $ENV") >> null
236231
result == PREFIX
237-
238232
}
239233

240234
def 'should create a conda environment - using micromamba' () {
241-
242235
given:
243236
def ENV = 'bwa=1.1.1'
244237
def PREFIX = Files.createTempDirectory('foo')
@@ -260,11 +253,9 @@ class CondaCacheTest extends Specification {
260253
0 * cache.makeAbsolute(_)
261254
1 * cache.runCommand("micromamba create --yes --quiet --prefix $PREFIX $ENV") >> null
262255
result == PREFIX
263-
264256
}
265257

266258
def 'should create a conda environment using mamba and remote lock file' () {
267-
268259
given:
269260
def ENV = 'http://foo.com/some/file-lock.yml'
270261
def PREFIX = Files.createTempDirectory('foo')
@@ -284,12 +275,11 @@ class CondaCacheTest extends Specification {
284275
then:
285276
1 * cache.isYamlFilePath(ENV)
286277
0 * cache.makeAbsolute(_)
287-
1 * cache.runCommand("mamba env create --prefix $PREFIX --file $ENV") >> null
278+
1 * cache.runCommand("mamba env create --yes --prefix $PREFIX --file $ENV") >> null
288279
result == PREFIX
289-
290280
}
291-
def 'should create a conda environment using micromamba and remote lock file' () {
292281

282+
def 'should create a conda environment using micromamba and remote lock file' () {
293283
given:
294284
def ENV = 'http://foo.com/some/file-lock.yml'
295285
def PREFIX = Files.createTempDirectory('foo')
@@ -311,7 +301,6 @@ class CondaCacheTest extends Specification {
311301
0 * cache.makeAbsolute(_)
312302
1 * cache.runCommand("micromamba env create --yes --prefix $PREFIX --file $ENV") >> null
313303
result == PREFIX
314-
315304
}
316305

317306
def 'should create conda env with options' () {

0 commit comments

Comments
 (0)