Skip to content

Commit

Permalink
Fix pip package discovery (#1534)
Browse files Browse the repository at this point in the history
- the old way of discovery of pip packages needed for testing
  was not taking into account new test separation into multiple
  shell scripts inside one test dir

Signed-off-by: Janusz Lisiecki <[email protected]>
  • Loading branch information
JanuszL authored Dec 3, 2019
1 parent ff53ceb commit e178fe9
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 11 deletions.
2 changes: 1 addition & 1 deletion qa/TL0_framework_imports/test.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash -e
./test_tf.sh
./test_mxnet.sh
./test_pytorch.sh
./test_pytorch.sh
6 changes: 6 additions & 0 deletions qa/TL0_python-self-test/test_no_setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
#!/bin/bash -ex

if [ -n "$gather_pip_packages" ]
then
# early exit
return 0
fi

source test_body.sh

pushd ../../dali/test/python
Expand Down
29 changes: 19 additions & 10 deletions qa/download_pip_packages.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
#!/usr/bin/env bash

mkdir -p /pip-packages
gather_pip_packages=yes
export gather_pip_packages=yes

for folder in $(ls -d */ | grep -v TL3);
do
echo ${folder}
echo "Checking folder: " ${folder}
pushd ${folder}
source test.sh
popd
echo ${pip_packages}
last_config_index=$(python setup_packages.py -n -u $pip_packages --cuda ${CUDA_VERSION})
for i in `seq 0 $last_config_index`;
# check all test files inside
for test_file in $(ls -f *.sh);
do
inst=$(python setup_packages.py -i $i -u $pip_packages --cuda ${CUDA_VERSION})
if [ -n "$inst" ]
export pip_packages=""
echo "Checking file: " ${test_file}
source ${test_file}
echo "PIPs to install: " ${pip_packages}
if test -n "$pip_packages"
then
pip download $inst -d /pip-packages
last_config_index=$(python ../setup_packages.py -n -u $pip_packages --cuda ${CUDA_VERSION})
for i in `seq 0 $last_config_index`;
do
inst=$(python ../setup_packages.py -i $i -u $pip_packages --cuda ${CUDA_VERSION})
if [ -n "$inst" ]
then
pip download $inst -d /pip-packages
fi
done
fi
done
popd
done

0 comments on commit e178fe9

Please sign in to comment.