Skip to content

Commit

Permalink
Install required dependencies from requirements.txt rather than
Browse files Browse the repository at this point in the history
convoluted galaxy.wheels method. Not sure why I was doing that.
Hackathons are dangerous places.
  • Loading branch information
natefoo committed Sep 21, 2015
1 parent 9027990 commit 40bde6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 23 deletions.
24 changes: 2 additions & 22 deletions lib/galaxy/wheels.py
Expand Up @@ -3,31 +3,17 @@

import sys

from os import pardir
from os.path import abspath, join, dirname

try:
import configparser
except:
import ConfigParser as configparser


BASE_REQUIREMENTS = []
OPTIONAL_REQUIREMENTS = (
'pysqlite',
'psycopg2',
)

for line in open(join(abspath(dirname(__file__)), pardir, pardir, 'requirements.txt')):
line = line.strip()
try:
line = line.split()[0]
except:
continue
if line.startswith( '#' ) or line == '':
continue
BASE_REQUIREMENTS.append( line )


class GalaxyConfig( object ):
def __init__( self, config_file ):
Expand Down Expand Up @@ -57,12 +43,6 @@ def check( self, name ):
return False


def requirements( config_file ):
def optional( config_file ):
config = GalaxyConfig( config_file )
rval = list(BASE_REQUIREMENTS)

for opt in OPTIONAL_REQUIREMENTS:
if config.check(opt):
rval.append( opt )

return rval
return [ opt for opt in OPTIONAL_REQUIREMENTS if config.check( opt ) ]
3 changes: 2 additions & 1 deletion scripts/common_startup.sh
Expand Up @@ -95,5 +95,6 @@ fi

if [ $FETCH_WHEELS -eq 1 ]; then
pip install -e git+https://github.com/natefoo/pip@linux-wheels#egg=pip
PYTHONPATH=lib python -c "import galaxy.wheels; print '\n'.join(galaxy.wheels.requirements('$GALAXY_CONFIG_FILE'))" | pip install -r /dev/stdin --index-url https://wheels.galaxyproject.org/simple/
pip install -r requirements.txt --index-url https://wheels.galaxyproject.org/simple/
PYTHONPATH=lib python -c "import galaxy.wheels; print '\n'.join(galaxy.wheels.optional('$GALAXY_CONFIG_FILE'))" | pip install -r /dev/stdin --index-url https://wheels.galaxyproject.org/simple/
fi

0 comments on commit 40bde6e

Please sign in to comment.