You need to sign in or sign up before continuing.
Newer
Older
1
2
3
4
5
6
7
8
9
10
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
#!/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
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