Changeset - 28fa94f56370
[Not reviewed]
stable
0 1 0
Mads Kiilerich - 6 years ago 2020-01-22 23:02:04
mads@kiilerich.com
Grafted from: 758c733151f7
scripts: handle "Python 2.7 reached the end of its life" message

The script failed with:

Error: pip detected following problems:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
1 file changed with 1 insertions and 1 deletions:
0 comments (0 inline, 0 general)
scripts/validate-minimum-dependency-versions
Show inline comments
 
@@ -25,25 +25,25 @@ mkdir -p "$venv"
 
# Make a light weight parsing of setup.py and dev_requirements.txt,
 
# finding all >= requirements and dumping into a custom requirements.txt
 
# while fixating the requirement at the lower bound.
 
sed -n 's/.*"\(.*\)>=\(.*\)".*/\1==\2/p' setup.py > "$min_requirements"
 
sed 's/>=/==/p' dev_requirements.txt >> "$min_requirements"
 

	
 
virtualenv -p "$(command -v python2)" "$venv"
 
source "$venv/bin/activate"
 
pip install --upgrade pip setuptools
 
pip install -e . -r "$min_requirements" python-ldap python-pam 2> >(tee "$log" >&2)
 

	
 
# Strip out the known Python 2.7 deprecation message.
 
sed -i '/DEPRECATION: Python 2\.7 will reach the end of its life/d' "$log"
 
sed -i '/DEPRECATION: Python 2\.7 /d' "$log"
 

	
 
# Treat any message on stderr as a problem, for the caller to interpret.
 
if [ -s "$log" ]; then
 
    echo
 
    echo "Error: pip detected following problems:"
 
    cat "$log"
 
    echo
 
    exit 1
 
fi
 

	
 
freeze_txt=build/minimum-dependency-versions.txt
 
pip freeze > $freeze_txt
0 comments (0 inline, 0 general)