diff --git a/scripts/update_cubeviz_test_env b/scripts/update_cubeviz_test_env index 4f14651cd..576c2dce3 100755 --- a/scripts/update_cubeviz_test_env +++ b/scripts/update_cubeviz_test_env @@ -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 diff --git a/scripts/update_cubeviz_test_env_pip b/scripts/update_cubeviz_test_env_pip new file mode 100755 index 000000000..c678d7286 --- /dev/null +++ b/scripts/update_cubeviz_test_env_pip @@ -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 +