@@ -82,7 +82,7 @@ def _conda_build_deps(channel):
82
82
return "conda install -y %s %s" % (" " .join (['-c %s' % c for c in channel ]),deps )
83
83
else :
84
84
return echo ("Skipping conda install (no build dependencies)" )
85
-
85
+
86
86
87
87
def _conda_install_with_options (options ,channel ,env_name_again ):
88
88
deps = get_dependencies (['install_requires' ]+ options )
@@ -142,8 +142,8 @@ def x(env_name,options,env_file):
142
142
from conda .models .match_spec import MatchSpec
143
143
144
144
deps = set ([MatchSpec (d ).name for d in _get_dependencies (['install_requires' ]+ options )])
145
-
146
- for what in E .dependencies :
145
+
146
+ for what in E .dependencies :
147
147
E .dependencies [what ] = [d for d in E .dependencies [what ] if MatchSpec (d ).name in deps ]
148
148
149
149
# fix up conda channels TODO: should probably just use non-env
@@ -152,7 +152,7 @@ def x(env_name,options,env_file):
152
152
packages = {package ['name' ]:package for package in json .loads (run_command (Commands .LIST ,"-p %s --json" % prefix )[0 ])}
153
153
E .dependencies ['conda' ] = ["%s%s" % ( (packages [MatchSpec (x ).name ]['channel' ]+ "::" if packages [MatchSpec (x ).name ]['channel' ]!= "defaults" else '' ) ,x ) for x in E .dependencies ['conda' ]]
154
154
E .channels = ["defaults" ]
155
-
155
+
156
156
# what could go wrong?
157
157
E .dependencies .raw = []
158
158
if len (E .dependencies .get ('conda' ,[]))> 0 :
@@ -250,6 +250,7 @@ def thing2(channel):
250
250
251
251
return {
252
252
'actions' : [
253
+ CmdAction (thing1 ),
253
254
CmdAction (thing2 )
254
255
],
255
256
'params' : [_channel_param ]}
@@ -296,7 +297,7 @@ def thing(channel,recipe):
296
297
"%(recipe)s" )
297
298
return cmd
298
299
299
-
300
+
300
301
def thing2 (channel ,pkg_tests ,test_python ,test_group ,test_requires ,recipe ):
301
302
cmds = []
302
303
if pkg_tests :
@@ -317,7 +318,7 @@ def create_recipe_append(recipe,test_python,test_group,test_requires,pkg_tests):
317
318
if yaml is None :
318
319
raise ValueError ("Install pyyaml or equivalent; see extras_require['ecosystem_conda']." )
319
320
320
- for (p ,g ,r ,w ) in test_matrix (test_python ,test_group ,test_requires ,['pkg' ]):
321
+ for (p ,g ,r ,w ) in test_matrix (test_python ,test_group ,test_requires ,['pkg' ]):
321
322
environment = get_env (p ,g ,r ,w )
322
323
deps = get_tox_deps (environment ,hack_one = True ) # note the hack_one, which is different from package_build
323
324
deps = [_join_the_club (d ) for d in deps ]
@@ -347,7 +348,7 @@ def remove_recipe_append_and_clobber(recipe,pkg_tests,test_python,test_group,tes
347
348
os .remove (p )
348
349
except :
349
350
pass
350
-
351
+
351
352
if not pkg_tests :
352
353
return
353
354
@@ -398,13 +399,13 @@ def task_package_build():
398
399
'type' :str ,
399
400
'default' :'' }
400
401
401
-
402
+
402
403
def create_recipe_clobber (recipe ,pin_deps_as_env ):
403
404
if pin_deps_as_env == '' :
404
405
return
405
406
else :
406
407
requirements_run = []
407
-
408
+
408
409
# TODO: unify with conda in env_export
409
410
env_name = pin_deps_as_env
410
411
import collections
@@ -423,7 +424,7 @@ def create_recipe_clobber(recipe,pin_deps_as_env):
423
424
# TODO: could add channel to the pin...
424
425
from conda .models .match_spec import MatchSpec
425
426
requirements_run = ["%s ==%s" % (MatchSpec (d ).name ,packagesd [MatchSpec (d ).name ]['version' ]) for d in deps ]
426
-
427
+
427
428
with open ("conda.recipe/%s/_pyctdev_recipe_clobber.yaml" % recipe ,'w' ) as f :
428
429
f .write (yaml .dump (
429
430
{
@@ -439,8 +440,8 @@ def thing0(channel):
439
440
deps = " " .join ('"%s"' % dep for dep in buildreqs )
440
441
return "conda install -y %s %s" % (" " .join (['-c %s' % c for c in channel ]),deps )
441
442
else :
442
- return 'echo "no build reqs"'
443
-
443
+ return 'echo "no build reqs"'
444
+
444
445
def thing (channel ,pin_deps_as_env ,recipe ):
445
446
cmd = "conda build %s conda.recipe/%s" % (" " .join (['-c %s' % c for c in channel ]),
446
447
"%(recipe)s" )
@@ -468,7 +469,7 @@ def create_recipe_append(recipe,test_python,test_group,test_requires,pkg_tests):
468
469
if yaml is None :
469
470
raise ValueError ("Install pyyaml or equivalent; see extras_require['ecosystem_conda']." )
470
471
471
- for (p ,g ,r ,w ) in test_matrix (test_python ,test_group ,test_requires ,['pkg' ]):
472
+ for (p ,g ,r ,w ) in test_matrix (test_python ,test_group ,test_requires ,['pkg' ]):
472
473
environment = get_env (p ,g ,r ,w )
473
474
deps = [_join_the_club (d ) for d in get_tox_deps (environment )]
474
475
cmds = get_tox_cmds (environment )
@@ -497,7 +498,7 @@ def remove_recipe_append_and_clobber(recipe,pkg_tests,test_python,test_group,tes
497
498
os .remove (p )
498
499
except :
499
500
pass
500
-
501
+
501
502
if not pkg_tests :
502
503
return
503
504
@@ -555,7 +556,7 @@ def thing(label):
555
556
'long' :'user' ,
556
557
'type' :str ,
557
558
'default' :'pyviz' }
558
-
559
+
559
560
return {'actions' : [CmdAction (thing )],
560
561
'params' : [label_param ,token_param ,recipe_param ,user_param ]}
561
562
@@ -608,8 +609,8 @@ def _morexx():
608
609
selfchan += "/label/dev"
609
610
610
611
return "conda install -y --name %(name)s -c " + selfchan + " pyctdev"
611
-
612
-
612
+
613
+
613
614
return {
614
615
'params' : [python ,name ,_channel_param ],
615
616
'uptodate' : [uptodate ],
@@ -634,9 +635,9 @@ def _env_exists(task,values):
634
635
else :
635
636
from conda .cli .python_api import Commands , run_command
636
637
return name in [os .path .basename (e ) for e in json .loads (run_command (Commands .INFO ,"--json" )[0 ])['envs' ]]
637
-
638
-
639
-
638
+
639
+
640
+
640
641
641
642
# TODO: doit - how to share parameters with dependencies? Lots of
642
643
# awkwardness here to work around that...
@@ -651,7 +652,7 @@ def _env_exists(task,values):
651
652
def task_develop_install ():
652
653
"""python develop install, with specified optional groups of dependencies (installed by conda only).
653
654
654
- Typically ``conda install "test dependencies" && pip install -e . --no-deps``.
655
+ Typically ``conda install "test dependencies" && pip install -e . --no-deps``.
655
656
656
657
Pass --options multiple times to specify other optional groups
657
658
(see project's setup.py for available options).
@@ -716,7 +717,7 @@ def _x(env_name):
716
717
f .write ("%s\n " % n )
717
718
f .write ("\n ***** dependencies *****\n " )
718
719
for e in edges :
719
- f .write ("%s -> %s\n " % e )
720
+ f .write ("%s -> %s\n " % e )
720
721
print ("wrote %s.txt (install graphviz for svg)" % env_name )
721
722
722
723
return {'actions' : [_x ,], 'params' :[env_name ,]}
0 commit comments