Commit 264eab26 authored by Godefroid Chapelle's avatar Godefroid Chapelle

Problem: Circle CI job fails

Solution: install proper pip
parent e16ea57b
......@@ -10,7 +10,7 @@ jobs:
python-version:
type: string
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2004:202111-01
environment:
BUILD_TYPE: << parameters.build-type >>
PYTHON_VER: << parameters.python-version >>
......@@ -35,6 +35,13 @@ jobs:
command: sudo apt-get update
- run:
command: sudo apt install -y build-essential python${PYTHON_VER}-dev
- when:
condition:
matches:
pattern: ^3\.10$
value: << parameters.python-version >>
steps:
- run: sudo apt install -y python${PYTHON_VER}-distutils
- checkout
- run:
command: ./ci_build.sh
......
......@@ -5,5 +5,8 @@ set -e
cd ../..
# Some machines come with preinstalled six
# which breaks test suite
pip${PYTHON_VER} uninstall -y six || true
python${PYTHON_VER} dev.py
bin/test -c -vvv
......@@ -76,25 +76,50 @@ def install_pip():
try:
import pip
print('')
try:
print(subprocess.check_output(
[sys.executable] + ['-m', 'pip', '--version'],
stderr=subprocess.STDOUT,
).decode('utf8'))
print('is installed.')
except subprocess.CalledProcessError as e:
# some debian/ubuntu based machines
# have broken pip installs
# that cannot import distutils or html5lib
# thus try to install via get-pip
if (b"ImportError" in e.output or
b"ModuleNotFoundError" in e.output):
install_pip()
raise e
except ImportError:
install_pip()
######################################################################
def check_upgrade(package):
print('')
print('Check %s' % package)
print('Try to upgrade %s' % package)
print('')
try:
sys.stdout.flush()
output = subprocess.check_output(
[sys.executable] + ['-m', 'pip', 'install', '--upgrade', package],
stderr=subprocess.STDOUT,
)
was_up_to_date = b"up-to-date" in output or b"already satisfied" in output
if not was_up_to_date:
print(output.decode('utf8'))
return not was_up_to_date
except subprocess.CalledProcessError:
except subprocess.CalledProcessError as e:
# some debian/ubuntu based machines
# have broken pip installs
# that cannot import distutils or html5lib
# thus try to install via get-pip
if (b"ImportError" in e.output or
b"ModuleNotFoundError" in e.output) :
install_pip()
return False
raise RuntimeError("Upgrade %s failed." % package)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment