File diff 4fa709087f77 → b3080953dcfc
roles/common/files/pip_check_requirements_upgrades.sh
Show inline comments
 
@@ -237,17 +237,33 @@ for environment in "$config_dir"/*; do
 
        # package versioning information.
 
        current=$(sed -e 's/[[:blank:]]*#.*//' "$req_txt" | grep -v "^$" | sort -u)
 

	
 
        # Calculate up-to-date requirements. Use backtracking resolver if available.
 
        # Set-up pip-compile invocation based on available options,
 
        # partially in order to get rid of the warnings.
 
        pip_compile_invocation=(
 
            "pip-compile"
 
            "--quiet"
 
            "--allow-unsafe"
 
            "--no-header"
 
            "--no-annotate"
 
            "--no-emit-index-url"
 
        )
 

	
 
        if pip-compile --help | grep -q -- --resolver; then
 
            new=$(pip-compile --quiet --resolver backtracking --allow-unsafe --no-header --no-annotate --no-emit-index-url --output-file - --upgrade "$req_in")
 
            result="$?"
 
        else
 
            new=$(pip-compile --quiet --allow-unsafe --no-header --no-annotate --no-emit-index-url --output-file - --upgrade "$req_in")
 
            result="$?"
 
            pip_compile_invocation+=("--resolver=backtracking")
 
        fi
 

	
 
        if [[ $result != 0 ]]; then
 
             error "Failed while running pip-compile command against (see error stack trace above): $req_in"
 
        if pip-compile --help | grep -q -- --strip-extras; then
 
            pip_compile_invocation+=("--strip-extras")
 
        fi
 

	
 
        pip_compile_invocation+=(
 
            "--output-file" "-"
 
            "--upgrade" "$req_in"
 
        )
 

	
 
        # Calculate up-to-date requirements.
 
        if ! new=$("${pip_compile_invocation[@]}"); then
 
            error "Failed while running pip-compile command against (see error stack trace above): $req_in"
 
            continue
 
        fi