Merge branch 'httpbin-python3'

Another fix for httpbin installation in CI builds.

Closes https://github.com/wxWidgets/wxWidgets/pull/2307
This commit is contained in:
Vadim Zeitlin
2021-04-05 16:37:27 +02:00
2 changed files with 25 additions and 23 deletions

View File

@@ -31,6 +31,7 @@ skip_commits:
- .travis.yml - .travis.yml
- build/tools/travis-ci.sh - build/tools/travis-ci.sh
- build/tools/before_install.sh - build/tools/before_install.sh
- build/tools/httpbin.sh
environment: environment:
matrix: matrix:

View File

@@ -17,26 +17,27 @@ httpbin_launch() {
case "$dist_codename" in case "$dist_codename" in
trusty) trusty)
# Current decorator (>= 5) is incompatible with Python 2 which we # Python 2.7.6 is too old to support SNI and can't be used.
# still use in some builds, so explicitly use a version which PY3=3
# is known to work. Just specifying "decorator==4.4.2" doesn't work
# neither for some reason ("no matching distribution found"), so
# use an explicit URL.
pip_decorator_arg='https://files.pythonhosted.org/packages/ed/1b/72a1821152d07cf1d8b6fce298aeb06a7eb90f4d6d41acec9861e7cc6df0/decorator-4.4.2-py2.py3-none-any.whl'
# We need to disable SSL certificate checking under Trusty because # Current decorator (>= 5) is incompatible with Python 3.4 used
# Python version there is too old to support SNI. # here, so explicitly use a version which is known to work.
pip_options='--trusted-host files.pythonhosted.org' pip_decorator_arg='decorator==4.4.2'
;; ;;
macOS) macOS)
# We use Python 2 under macOS 10.11 which doesn't have Python 3,
# and decorator >= 5 is incompatible with it too.
pip_decorator_arg='decorator==4.4.2' pip_decorator_arg='decorator==4.4.2'
;; ;;
*) *)
# Elsewhere just use Python 3. # Elsewhere just use Python 3.
PY3=3 PY3=3
;;
esac
if [ "$PY3" = 3 ]; then
# Ensure that we have at least some version of pip. # Ensure that we have at least some version of pip.
if ! python3 -m pip; then if ! python3 -m pip; then
sudo apt-get -q -o=Dpkg::Use-Pty=0 install python3-pip sudo apt-get -q -o=Dpkg::Use-Pty=0 install python3-pip
@@ -47,14 +48,14 @@ httpbin_launch() {
# than python3, so upgrade it to fix this. # than python3, so upgrade it to fix this.
# #
# However don't upgrade to a version which is too new because then # However don't upgrade to a version which is too new because then
# it may not support Python version that we actually have. # it may not support Python version that we actually have (this one
python3 -m pip install --user --upgrade pip==20.0.1 # still works with 3.4, 20.0.1 is the last one to support 3.5).
;; python3 -m pip install --user --upgrade pip==19.1.1
esac fi
echo "Installing using `python$PY3 -m pip --version`" echo "Installing using `python$PY3 -m pip --version`"
python$PY3 -m pip install $pip_decorator_arg httpbin --user $pip_options python$PY3 -m pip install $pip_decorator_arg httpbin --user
python$PY3 -m httpbin.core 2>&1 >httpbin.log & python$PY3 -m httpbin.core 2>&1 >httpbin.log &
WX_TEST_WEBREQUEST_URL="http://localhost:5000" WX_TEST_WEBREQUEST_URL="http://localhost:5000"