Skip to content

Commit

Permalink
Merge pull request #291 from brechmos-stsci/tester-script
Browse files Browse the repository at this point in the history
WIP: Updating the update script for the testers
  • Loading branch information
drdavella committed Mar 13, 2018
2 parents 40a1aa0 + 30a2a35 commit 6f9790b
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 9 deletions.
19 changes: 10 additions & 9 deletions scripts/update_cubeviz_test_env
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
#! /bin/sh

echo "Going to update conda environment test-cubeviz-conda"

set -eu

conda_env=`conda env list | grep '*' | cut -d\ -f1`
min_conda_version="4.4"
download_location="https://raw.githubusercontent.com/spacetelescope/cubeviz/master/scripts/update_cubeviz_test_env_pip"

if [ "$conda_env" != "test-cubeviz-conda" ]; then
echo "Must be in the test-cubeviz-conda conda environment"
exit 1
fi

conda_version=$(conda --version | cut -d\ -f2 | cut -d. -f1,2)
if [[ "$conda_version" < "$min_conda_version" ]]; then
echo "WARNING: your conda version is out of date ($(conda --version))." \
"This may cause issues with installing the latest version of cubeviz" \
"and its dependencies."
fi
# Grab the script:
echo "Downloading the update script"
output_file=`mktemp`

conda update --update-deps -c glueviz/label/dev -c glueviz -c http://ssb.stsci.edu/astroconda-dev cubeviz --yes
# https://stackoverlfow.com/questions/14411103/check-for-existence-of-wget-curl
wget -O - --no-check-certificate $download_location > $output_file || curl -o $output_file $download_location

echo "CubeViz test environment has been updated to the following:"
conda list "cubeviz|glue-core|specviz|specutils|spectral-cube"
echo "Running the update script $output_file"
sh $output_file
33 changes: 33 additions & 0 deletions scripts/update_cubeviz_test_env_pip
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#! /bin/sh

glue_hash="cc1dc09bff7113ab679a75dd7617456c5f85e005"
spectral_cube_hash="cd06db6c5658baa2e182565b4fc6b337e383c8f1"
specviz_hash="437e5ca0d1da6b1099f89d2ee6230b19ff785796"
cubeviz_hash="029302d36722d765a8dea2f38638ff1856c23e65"
specutils_hash="legacy-specutils"
astropy_hash="46b59dddfba1e24f39e64dccbd9eb6488e1f8df0"

set -eu

echo "Checking to make sure we are in the right conda environment"
conda_env=`conda env list | grep '*' | cut -d\ -f1`
if [ "$conda_env" != "test-cubeviz-conda" ]; then
echo "Must be in the test-cubeviz-conda conda environment"
exit 1
fi

# Remove anything installed by conda, if there is an error, i.e., no packages
# then continue processing
echo "Remove a few of the conda packages we want to replace"
conda remove astropy glue-core spectral-cube specviz cubeviz specutils || true

# Install specific versions of each packages
echo "pip install the packages based on the commit hashes"
pip install --upgrade \
git+https://github.com/glue-viz/glue@${glue_hash} \
git+https://github.com/radio-astro-tools/spectral-cube@${spectral_cube_hash} \
git+https://github.com/spacetelescope/specviz@${specviz_hash} \
git+https://github.com/spacetelescope/cubeviz@${cubeviz_hash} \
git+https://github.com/astropy/specutils.git@${specutils_hash} \
git+https://github.com/astropy/astropy@${astropy_hash}#egg=astropy

0 comments on commit 6f9790b

Please sign in to comment.