Skip to content

Commit 6f9790b

Browse files
authored
Merge pull request #291 from brechmos-stsci/tester-script
WIP: Updating the update script for the testers
2 parents 40a1aa0 + 30a2a35 commit 6f9790b

File tree

2 files changed

+43
-9
lines changed

2 files changed

+43
-9
lines changed

scripts/update_cubeviz_test_env

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
#! /bin/sh
22

3+
echo "Going to update conda environment test-cubeviz-conda"
4+
35
set -eu
46

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

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

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

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

22-
echo "CubeViz test environment has been updated to the following:"
23-
conda list "cubeviz|glue-core|specviz|specutils|spectral-cube"
23+
echo "Running the update script $output_file"
24+
sh $output_file
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#! /bin/sh
2+
3+
glue_hash="cc1dc09bff7113ab679a75dd7617456c5f85e005"
4+
spectral_cube_hash="cd06db6c5658baa2e182565b4fc6b337e383c8f1"
5+
specviz_hash="437e5ca0d1da6b1099f89d2ee6230b19ff785796"
6+
cubeviz_hash="029302d36722d765a8dea2f38638ff1856c23e65"
7+
specutils_hash="legacy-specutils"
8+
astropy_hash="46b59dddfba1e24f39e64dccbd9eb6488e1f8df0"
9+
10+
set -eu
11+
12+
echo "Checking to make sure we are in the right conda environment"
13+
conda_env=`conda env list | grep '*' | cut -d\ -f1`
14+
if [ "$conda_env" != "test-cubeviz-conda" ]; then
15+
echo "Must be in the test-cubeviz-conda conda environment"
16+
exit 1
17+
fi
18+
19+
# Remove anything installed by conda, if there is an error, i.e., no packages
20+
# then continue processing
21+
echo "Remove a few of the conda packages we want to replace"
22+
conda remove astropy glue-core spectral-cube specviz cubeviz specutils || true
23+
24+
# Install specific versions of each packages
25+
echo "pip install the packages based on the commit hashes"
26+
pip install --upgrade \
27+
git+https://github.com/glue-viz/glue@${glue_hash} \
28+
git+https://github.com/radio-astro-tools/spectral-cube@${spectral_cube_hash} \
29+
git+https://github.com/spacetelescope/specviz@${specviz_hash} \
30+
git+https://github.com/spacetelescope/cubeviz@${cubeviz_hash} \
31+
git+https://github.com/astropy/specutils.git@${specutils_hash} \
32+
git+https://github.com/astropy/astropy@${astropy_hash}#egg=astropy
33+

0 commit comments

Comments
 (0)