Skip to content

Commit c652851

Browse files
committed
Reverting conda pin
1 parent ab17745 commit c652851

File tree

2 files changed

+25
-24
lines changed

2 files changed

+25
-24
lines changed

pyctdev/_conda.py

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def _conda_build_deps(channel):
8282
return "conda install -y %s %s"%(" ".join(['-c %s'%c for c in channel]),deps)
8383
else:
8484
return echo("Skipping conda install (no build dependencies)")
85-
85+
8686

8787
def _conda_install_with_options(options,channel,env_name_again):
8888
deps = get_dependencies(['install_requires']+options)
@@ -142,8 +142,8 @@ def x(env_name,options,env_file):
142142
from conda.models.match_spec import MatchSpec
143143

144144
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:
147147
E.dependencies[what] = [d for d in E.dependencies[what] if MatchSpec(d).name in deps]
148148

149149
# fix up conda channels TODO: should probably just use non-env
@@ -152,7 +152,7 @@ def x(env_name,options,env_file):
152152
packages = {package['name']:package for package in json.loads(run_command(Commands.LIST,"-p %s --json"%prefix)[0])}
153153
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']]
154154
E.channels = ["defaults"]
155-
155+
156156
# what could go wrong?
157157
E.dependencies.raw = []
158158
if len(E.dependencies.get('conda',[]))>0:
@@ -250,6 +250,7 @@ def thing2(channel):
250250

251251
return {
252252
'actions': [
253+
CmdAction(thing1),
253254
CmdAction(thing2)
254255
],
255256
'params': [_channel_param]}
@@ -296,7 +297,7 @@ def thing(channel,recipe):
296297
"%(recipe)s")
297298
return cmd
298299

299-
300+
300301
def thing2(channel,pkg_tests,test_python,test_group,test_requires,recipe):
301302
cmds = []
302303
if pkg_tests:
@@ -317,7 +318,7 @@ def create_recipe_append(recipe,test_python,test_group,test_requires,pkg_tests):
317318
if yaml is None:
318319
raise ValueError("Install pyyaml or equivalent; see extras_require['ecosystem_conda'].")
319320

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']):
321322
environment = get_env(p,g,r,w)
322323
deps = get_tox_deps(environment,hack_one=True) # note the hack_one, which is different from package_build
323324
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
347348
os.remove(p)
348349
except:
349350
pass
350-
351+
351352
if not pkg_tests:
352353
return
353354

@@ -398,13 +399,13 @@ def task_package_build():
398399
'type':str,
399400
'default':''}
400401

401-
402+
402403
def create_recipe_clobber(recipe,pin_deps_as_env):
403404
if pin_deps_as_env == '':
404405
return
405406
else:
406407
requirements_run = []
407-
408+
408409
# TODO: unify with conda in env_export
409410
env_name = pin_deps_as_env
410411
import collections
@@ -423,7 +424,7 @@ def create_recipe_clobber(recipe,pin_deps_as_env):
423424
# TODO: could add channel to the pin...
424425
from conda.models.match_spec import MatchSpec
425426
requirements_run = ["%s ==%s"%(MatchSpec(d).name,packagesd[MatchSpec(d).name]['version']) for d in deps]
426-
427+
427428
with open("conda.recipe/%s/_pyctdev_recipe_clobber.yaml"%recipe,'w') as f:
428429
f.write(yaml.dump(
429430
{
@@ -439,8 +440,8 @@ def thing0(channel):
439440
deps = " ".join('"%s"'%dep for dep in buildreqs)
440441
return "conda install -y %s %s"%(" ".join(['-c %s'%c for c in channel]),deps)
441442
else:
442-
return 'echo "no build reqs"'
443-
443+
return 'echo "no build reqs"'
444+
444445
def thing(channel,pin_deps_as_env,recipe):
445446
cmd = "conda build %s conda.recipe/%s"%(" ".join(['-c %s'%c for c in channel]),
446447
"%(recipe)s")
@@ -468,7 +469,7 @@ def create_recipe_append(recipe,test_python,test_group,test_requires,pkg_tests):
468469
if yaml is None:
469470
raise ValueError("Install pyyaml or equivalent; see extras_require['ecosystem_conda'].")
470471

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']):
472473
environment = get_env(p,g,r,w)
473474
deps = [_join_the_club(d) for d in get_tox_deps(environment)]
474475
cmds = get_tox_cmds(environment)
@@ -497,7 +498,7 @@ def remove_recipe_append_and_clobber(recipe,pkg_tests,test_python,test_group,tes
497498
os.remove(p)
498499
except:
499500
pass
500-
501+
501502
if not pkg_tests:
502503
return
503504

@@ -555,7 +556,7 @@ def thing(label):
555556
'long':'user',
556557
'type':str,
557558
'default':'pyviz'}
558-
559+
559560
return {'actions': [CmdAction(thing)],
560561
'params': [label_param,token_param,recipe_param,user_param]}
561562

@@ -608,8 +609,8 @@ def _morexx():
608609
selfchan+="/label/dev"
609610

610611
return "conda install -y --name %(name)s -c " + selfchan + " pyctdev"
611-
612-
612+
613+
613614
return {
614615
'params': [python,name,_channel_param],
615616
'uptodate': [uptodate],
@@ -634,9 +635,9 @@ def _env_exists(task,values):
634635
else:
635636
from conda.cli.python_api import Commands, run_command
636637
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+
640641

641642
# TODO: doit - how to share parameters with dependencies? Lots of
642643
# awkwardness here to work around that...
@@ -651,7 +652,7 @@ def _env_exists(task,values):
651652
def task_develop_install():
652653
"""python develop install, with specified optional groups of dependencies (installed by conda only).
653654
654-
Typically ``conda install "test dependencies" && pip install -e . --no-deps``.
655+
Typically ``conda install "test dependencies" && pip install -e . --no-deps``.
655656
656657
Pass --options multiple times to specify other optional groups
657658
(see project's setup.py for available options).
@@ -716,7 +717,7 @@ def _x(env_name):
716717
f.write("%s\n"%n)
717718
f.write("\n***** dependencies *****\n")
718719
for e in edges:
719-
f.write("%s -> %s\n"%e)
720+
f.write("%s -> %s\n"%e)
720721
print("wrote %s.txt (install graphviz for svg)"%env_name)
721722

722723
return {'actions': [_x,], 'params':[env_name,]}

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
name = 'pyctdev',
1010
description = 'python packaging common tasks for developers',
1111
long_description=open("README.md").read(),
12-
long_description_content_type="text/markdown",
12+
long_description_content_type="text/markdown",
1313
version = versioneer.get_version().lstrip('v'),
1414
cmdclass = versioneer.get_cmdclass(),
1515
license = 'BSD-3',
@@ -49,7 +49,7 @@
4949
# not sure exactly which versions
5050
# (actually, cb pin is for tested/known good version
5151
# TODO: beware pin here and in _conda.py!
52-
'ecosystem_conda': ['conda <4.6', 'conda-build ==3.10.1']
52+
'ecosystem_conda': ['conda >=4.4', 'conda-build ==3.10.1']
5353
}
5454
)
5555

0 commit comments

Comments
 (0)