Skip to content

Commit

Permalink
Handle get-pip.py breaking change on Python 2.7.
Browse files Browse the repository at this point in the history
  • Loading branch information
mattclay committed Jan 23, 2021
1 parent 7f6fcc3 commit 484e4af
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions changelogs/fragments/ansible-test-pip-bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- ansible-test - The ``--remote`` option has been updated for Python 2.7 to work around breaking changes in the newly released ``get-pip.py`` bootstrapper.
10 changes: 9 additions & 1 deletion test/lib/ansible_test/_data/setup/remote.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ cd ~/

install_pip () {
if ! "${python_interpreter}" -m pip.__main__ --version --disable-pip-version-check 2>/dev/null; then
curl --silent --show-error https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py
case "${python_version}" in
"2.7")

This comment has been minimized.

Copy link
@webknjaz

webknjaz Jan 24, 2021

Member

@mattclay I'm almost sure the same is needed for Python 3.5 too.

This comment has been minimized.

Copy link
@mattclay

mattclay Jan 25, 2021

Author Member

Correct. However, we don't have any remote platforms using Python 3.5, so there was no point in adding it.

This comment has been minimized.

Copy link
@webknjaz

webknjaz Jan 25, 2021

Member

Oh, I didn't realize it's remote-only

pip_bootstrap_url="https://bootstrap.pypa.io/${python_version}/get-pip.py"
;;
*)
pip_bootstrap_url="https://bootstrap.pypa.io/get-pip.py"
;;
esac
curl --silent --show-error "${pip_bootstrap_url}" -o /tmp/get-pip.py
"${python_interpreter}" /tmp/get-pip.py --disable-pip-version-check --quiet
rm /tmp/get-pip.py
fi
Expand Down

0 comments on commit 484e4af

Please sign in to comment.