Update location identification (#18834)

This commit is contained in:
Lysandre Debut 2022-08-31 15:10:25 +02:00 committed by GitHub
parent e4910213be
commit ee407024c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -41,10 +41,12 @@ jobs:
run: | run: |
. ~/venv/bin/activate . ~/venv/bin/activate
python setup.py develop python setup.py develop
transformer_loc=$(pip show transformers | grep "Location: " | cut -c11-) transformers_install=$(pip list -e | grep transformers)
transformer_repo_loc=$(pwd .) transformers_install_array=($transformers_install)
if [ "$transformer_loc" != "$transformer_repo_loc/src" ]; then transformers_loc=${transformers_install_array[-1]}
echo "transformers is from $transformer_loc but it shoud be from $transformer_repo_loc/src." transformers_repo_loc=$(pwd .)
if [ "$transformers_loc" != "$transformers_repo_loc" ]; then
echo "transformers is from $transformers_loc but it shoud be from $transformers_repo_loc/src."
echo "A fix is required. Stop testing." echo "A fix is required. Stop testing."
exit 1 exit 1
fi fi