Newer
Older
#!/bin/bash
# Set up conda environment, if necessary,
# then in each module:
# 1. run setup
# 2. if there is a test/ subdirectory, execute pytest therein
# Caveat Programmor: this is just a convenience thing Janet created
# for her own use -- it's NOT production-ready! A robust implementation
# of this functionality is in progress for
# https://open-jira.nrao.edu/browse/SSA-6727.
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
TOP_LEVEL=/Users/jgoldste/Projects/data/
cd $TOP_LEVEL
if [ -z $CONDA_DEFAULT_ENV ]
then
echo '>>> Updating conda environment....'
conda env update
echo '>>> Activating....'
conda activate data
else
echo "conda environment '${CONDA_DEFAULT_ENV}' is active"
fi
SETUP=setup.py
echo ">>> looking for ${SETUP} in all modules...."
SETUPS=$(find . -name $SETUP -exec echo '{}' \;)
for item in $SETUPS
do
dir=$(dirname $item)
dir=${TOP_LEVEL}${dir:1}
cd ${dir}
if [ -z $? ]
then
exit $?
fi
echo ">>> running ${SETUP} in ${dir}...."
python setup.py develop
if [ -d $dir/test ]
then
cd test
pytest --log-level=DEBUG --showlocals
fi
done