Thin out dependency relocking script

pull/1931/head
Kieran R. Prasch 2020-04-24 10:48:03 -07:00
parent 5f988ddd9d
commit 1bcd98b898
1 changed files with 7 additions and 30 deletions

37
scripts/installation/relock_dependencies.sh Normal file → Executable file
View File

@ -1,48 +1,25 @@
#!/usr/bin/env bash
set -e
# can change output file names with rebuild_pipenv.sh <prefix>
PREFIX=${1:-requirements}
read -p "Update your pip and setuptools? (type y or Y) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
pip install --upgrade pip
pip install --upgrade setuptools
fi
# these steps might fail, but that's okay.
echo "Removing existing lock files..."
pipenv --rm
rm -f Pipfile.lock
rm -f $PREFIX.txt
rm -f dev-$PREFIX.txt
read -p "Remove system pip and pipenv cache? (type y or Y) " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
echo "Removing pip and pipenv system cache..."
rm -r ~/.cache/pip ~/.cache/pipenv
fi
echo "Removing pip and pipenv system cache..."
rm -r ~/.cache/pip ~/.cache/pipenv
echo "Rebuilding dependency locks..."
# start enforcing failures
set -e
echo "Bulding dev-$PREFIX.txt..."
echo "Building Development Requirements"
pipenv lock --clear --pre --requirements --dev > dev-$PREFIX.txt
echo "Building $PREFIX.txt..."
echo "Building Standard Requirements"
pipenv lock --clear --pre --requirements > $PREFIX.txt
echo "Installing nucypher into new virtual enviorment..."
pipenv run pip install -e . -r dev-$PREFIX.txt
echo "Checking nucypher CLI entry point..."
pipenv run nucypher --version
echo "Committing Result..."
git add Pipfile Pipfile.lock $PREFIX.txt dev-$PREFIX.txt
git commit -m "Relock dependencies"
echo "OK!"