Skip to content

Commit

Permalink
Fix version checking with local installation. Support python installa…
Browse files Browse the repository at this point in the history
…tion with conda in addition to pip. Build fixes for new CloudBioLinux release
  • Loading branch information
chapmanb committed Jul 5, 2013
1 parent 44f1010 commit a600df2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 11 deletions.
4 changes: 2 additions & 2 deletions cloudbio/custom/versioncheck.py
Expand Up @@ -10,10 +10,10 @@

from cloudbio.custom import shared

def _parse_from_stdoutflag(stdout, flag):
def _parse_from_stdoutflag(out, flag):
"""Extract version information from a flag in verbose stdout.
"""
for line in stdout.split("\n"):
for line in out.split("\n") + out.stderr.split("\n"):
if line.find(flag) >= 0:
parts = [x for x in line.split() if not x.startswith(flag)]
return parts[0]
Expand Down
2 changes: 1 addition & 1 deletion config/perl-libs.yaml
Expand Up @@ -203,7 +203,7 @@ cpan:
- 'Bio::ASN1::EntrezGene'
- 'Bio::Graphics'
- 'Bio::Phylo'
- 'BioPerl'
- 'http://www.cpan.org/authors/id/C/CJ/CJFIELDS/BioPerl-1.6.901.tar.gz'
- 'Bio::Das'
- 'Bio::GFF3::LowLevel'
# Currently have problems building on CentOS
Expand Down
4 changes: 1 addition & 3 deletions config/python-libs.yaml
Expand Up @@ -25,11 +25,9 @@ pypi:
- yolk
# build
- Pyrex
- virtualenv
# concurrency/web
- Twisted
# science
- bcbio-nextgen
- cutadapt
- ruffus
- DendroPy
Expand All @@ -49,7 +47,6 @@ pypi:
# visualization
- gnuplot-py
- PIL
- pydot
- pygooglechart
- pypdf
- reportlab
Expand Down Expand Up @@ -83,3 +80,4 @@ conda:
#- pygraphviz
#- pysparse
#- sympy
#- pydot # references python 3-only pyparsing
17 changes: 12 additions & 5 deletions fabfile.py
Expand Up @@ -321,13 +321,20 @@ def _read_main_config():

def _python_library_installer(config):
"""Install python specific libraries using easy_install.
Handles using isolated anaconda environments.
"""
version_ext = "-%s" % env.python_version_ext if env.python_version_ext else ""
env.safe_sudo("easy_install%s -U pip" % version_ext)
with quiet():
is_anaconda = env.safe_run("conda -V").startswith("conda")
if is_anaconda:
for pname in env.flavor.rewrite_config_items("python", config.get("conda", [])):
env.safe_run("conda install --yes {0}".format(pname))
cmd = env.safe_run
else:
version_ext = "-%s" % env.python_version_ext if env.python_version_ext else ""
env.safe_sudo("easy_install%s -U pip" % version_ext)
cmd = env.safe_sudo
for pname in env.flavor.rewrite_config_items("python", config['pypi']):
env.safe_sudo("{0} install --upgrade {1}".format(_pip_cmd(env), pname))
for pname in env.flavor.rewrite_config_items("python", config.get("conda", [])):
env.save_sudo("conda install {1}".format(pname))
cmd("{0} install --upgrade {1}".format(_pip_cmd(env), pname))

def _ruby_library_installer(config):
"""Install ruby specific gems.
Expand Down

0 comments on commit a600df2

Please sign in to comment.