Skip to content

Commit

Permalink
Merge branch 'buildbot-nightly_/conda' into 'buildbot-nightly'
Browse files Browse the repository at this point in the history
  • Loading branch information
remram44 committed Oct 23, 2014
2 parents 23b5b6a + ff13035 commit 146b810
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 9 deletions.
5 changes: 4 additions & 1 deletion dist/conda/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ package, just the `vistrails` directory alongside this README**.
# Install Anaconda
./Anaconda-2.0.1-*.sh
# Install patchelf
# Install patchelf (from conda)
conda install patchelf
# Install patchelf (manually)
sudo aptitude install build-essential git autoconf autoreconf
git clone https://github.com/NixOS/patchelf.git
cd patchelf/
Expand Down
63 changes: 63 additions & 0 deletions dist/conda/conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/sh

# This script automatically builds a Conda package

cd "$(dirname "$0")/../.."
VT_DIR="$(pwd)"

# Clears Conda cache
ANACONDA_CACHE="$(dirname "$(which python)")/../conda-bld/src_cache/vistrails.tar.gz"
rm -f "$ANACONDA_CACHE"

if [ -z "$1" ]; then
echo "Usage: $(basename $0) <target_directory> [version]" >&2
exit 1
fi
if [ -z "$2" ]; then
VERSION="$(../get_version.sh)"
else
VERSION="$2"
fi

DEST_DIR="$1"

TEMP_DIR=$(mktemp -d)

# Builds source distribution
if ! python setup.py sdist --dist-dir $TEMP_DIR; then
rm -Rf $TEMP_DIR
exit 1
fi

# Creates symlink
TEMP_FILE="$(echo $TEMP_DIR/*)"
ln -s "$TEMP_FILE" $TEMP_DIR/vistrails.tar.gz

# Copies conda recipe
cp -r dist/conda/vistrails $TEMP_DIR/vistrails

# Changes version in recipe
VERSION_ESCAPED="$(echo "$VERSION" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')"
sed -i "s/_REPLACE_version_REPLACE_/$VERSION_ESCAPED/g" $TEMP_DIR/vistrails/meta.yaml

# Changes URL
URL_ESCAPED="$(echo "file://$TEMP_DIR/vistrails.tar.gz" | sed 's/\\/\\\\/g' | sed 's/\//\\\//g')"
sed -i "s/_REPLACE_url_REPLACE_/$URL_ESCAPED/g" $TEMP_DIR/vistrails/meta.yaml

# Builds Conda package
cd $TEMP_DIR
OUTPUT_PKG="$(conda build --output vistrails)"
if ! conda build vistrails; then
rm -Rf $TEMP_DIR
rm -f "$ANACONDA_CACHE"
exit 1
fi

# Copies result out
cp "$OUTPUT_PKG" $DEST_DIR/

# Removes temporary directory
rm -Rf $TEMP_DIR

# Clears Conda cache
rm -f "$ANACONDA_CACHE"
12 changes: 4 additions & 8 deletions dist/conda/vistrails/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
package:
name: vistrails
version: !!str 2.1.4
version: !!str _REPLACE_version_REPLACE_

source:
fn: vistrails-2.1.4.tar.gz
url: https://pypi.python.org/packages/source/v/vistrails/vistrails-2.1.4.tar.gz
md5: 9560fa3f9bce61f1ac70841c90ff208a
# patches:
# List any patch files here
# - fix.patch
fn: vistrails.tar.gz
url: _REPLACE_url_REPLACE_

build:
#preserve_egg_dir: True
Expand Down Expand Up @@ -49,7 +45,7 @@ test:
# You can put test commands to be run here. Use this to test that the
# entry points work.

- vistrails --help
- python -m vistrails.tests

# You can also put a file called run_test.py in the recipe that will be run
# at test time.
Expand Down
18 changes: 18 additions & 0 deletions vistrails/gui/mashups/mashup_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,9 +611,27 @@ def toggleTitleBar(self):


class TestMashupApp(TestVisTrailsGUI):
def setUp(self):
super(TestMashupApp, self).setUp()
try:
import vtk
except ImportError:
self.skipTest("VTK is not available")
from vistrails.core.packagemanager import get_package_manager
from vistrails.core.modules.module_registry import MissingPackage
pm = get_package_manager()
identifier = 'org.vistrails.vistrails.vtk'
try:
pkg = pm.get_package(identifier)
except MissingPackage:
pkg = pm.identifier_is_available(identifier)
if pkg:
pm.late_enable_package(pkg.codepath)
pkg = pm.get_package(identifier)

def test_load_mashup(self):
import vistrails.core.system
import vistrails.api
filename = (vistrails.core.system.vistrails_root_directory() +
'/tests/resources/spx_loop.vt')
view = vistrails.api.open_vistrail_from_file(filename)
Expand Down

0 comments on commit 146b810

Please sign in to comment.