Skip to content

Instantly share code, notes, and snippets.

@Jamim
Last active July 27, 2018 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jamim/be3a54eec4d2e9603598b968e603a339 to your computer and use it in GitHub Desktop.
Save Jamim/be3a54eec4d2e9603598b968e603a339 to your computer and use it in GitHub Desktop.
detect-pipenv-lock-bug.sh
#!/bin/bash
ATTEMPTS=20
step () {
tput setaf 5; tput bold
echo
echo "$@"
tput sgr 0
}
step "Creating a test directory"
mkdir pipenv-test || exit 1
cd pipenv-test
step "Installing requirements"
pipenv --two install pytest-cov pytest-vcr
step "Locking dependencies"
pipenv lock --verbose
step "Adding result files to a git repository"
git init
git add Pipfile Pipfile.lock
git commit -m 'Initial commit'
step "Trying to bring out the issue"
attempt=0
while [ $attempt -lt ${ATTEMPTS} ]
do
attempt=$[$attempt + 1]
sleep 2
tput setaf 3; tput bold
echo "Attempt ${attempt}"
tput sgr 0
pipenv lock --verbose
echo
if [ -n "$(git diff)" ]
then
git --no-pager diff
echo
tput setaf 1; tput bold
echo "Something was changed on attempt ${attempt}"
tput sgr 0
exit 1
fi
done
step "No issues were found after ${ATTEMPTS} attempts"
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment