AngellusMortis/django_microsoft_auth

View on GitHub
.bin/update-requirements

Summary

Maintainability
Test Coverage
#!/bin/bash

set -o errexit
set -o pipefail
set -o nounset

BASE_DIR=$( realpath $( dirname "${BASH_SOURCE[0]}" )/../ )
source "$BASE_DIR/.bin/lib/common.sh"
setRoot

pushd "$ROOT_PATH" 2>&1 >/dev/null

dj_versions=("3.2" "4.0" "4.1")
dj_stable="4.1"

for dj_version in "${dj_versions[@]}"; do
    echo "Generating requirements for Django $dj_version..."
    django_reqs="django~=$dj_version"
    extras="--extra=dev"
    if [[ "$dj_version" == "$dj_stable" ]]; then
        django_reqs="django~=$dj_stable\ndjango-constance[database]"
        extras="--extra=dev --extra=ql"
    fi
    echo -e "$django_reqs" > django.in
    CUSTOM_COMPILE_COMMAND="./.bin/update-requirements" pip-compile --pip-args='--root-user-action=ignore' --resolver=backtracking -q $extras --upgrade --output-file=reqs/dj$dj_version-requirements.txt pyproject.toml django.in
    rm django.in
done

echo "Installing new requirements..."
pip install --root-user-action=ignore -r ./reqs/dj$dj_stable-requirements.txt
pip install --root-user-action=ignore -e ".[dev,ql]"

popd 2>&1 >/dev/null