Fix for PEP517 issue with Python 3.6.8
When creating a virtualenv with Python 3.6.8 using the --system-site-packages option and pip>=19.0.0 a bug affects the virtualenv breaking pep build isolation. This patch downgrade pip to version 19.0.0 as a workaround. Also converts pip3 command to pip. See [1] for more info. [1] https://github.com/pypa/pip/issues/6264 Change-Id: I738d7c2e50914a773920e5381305e8c5131ccd5f
This commit is contained in:
@@ -309,7 +309,7 @@ ironic_inspector:
|
|||||||
# DEPRECATED(TheJulia): Inheritance of ironic_db_password params
|
# DEPRECATED(TheJulia): Inheritance of ironic_db_password params
|
||||||
# should be removed in Queens.
|
# should be removed in Queens.
|
||||||
|
|
||||||
pip_opts: "--upgrade-strategy only-if-needed"
|
pip_opts: "{{ lookup('env', 'PIP_OPTS') | default('') }}"
|
||||||
|
|
||||||
# Timeout for gathering facts.
|
# Timeout for gathering facts.
|
||||||
fact_gather_timeout: "{{ lookup('config', 'DEFAULT_GATHER_TIMEOUT', on_missing='skip') | default(omit, true) }}"
|
fact_gather_timeout: "{{ lookup('config', 'DEFAULT_GATHER_TIMEOUT', on_missing='skip') | default(omit, true) }}"
|
||||||
|
|||||||
@@ -19,6 +19,11 @@
|
|||||||
venv_command: "python3 -m venv"
|
venv_command: "python3 -m venv"
|
||||||
when: enable_venv
|
when: enable_venv
|
||||||
|
|
||||||
|
- name: workaround for PEP517 issue
|
||||||
|
set_fact:
|
||||||
|
extra_args: ""
|
||||||
|
when: ansible_python_version == "3.6.8"
|
||||||
|
|
||||||
- name: Set extra_args if upper_constraints_file is defined
|
- name: Set extra_args if upper_constraints_file is defined
|
||||||
set_fact:
|
set_fact:
|
||||||
constraints_extra_args: "{{ extra_args | default('') }} -c {{ upper_constraints_file }}"
|
constraints_extra_args: "{{ extra_args | default('') }} -c {{ upper_constraints_file }}"
|
||||||
@@ -57,12 +62,10 @@
|
|||||||
delay: 10
|
delay: 10
|
||||||
when: (source_install is not defined or source_install | bool == false ) and enable_venv | default(false) | bool == false
|
when: (source_install is not defined or source_install | bool == false ) and enable_venv | default(false) | bool == false
|
||||||
|
|
||||||
# NOTE (cinerama): We should be able to use the pip module here
|
|
||||||
- name: "Install requirements from {{ sourcedir }} using pip"
|
- name: "Install requirements from {{ sourcedir }} using pip"
|
||||||
command: |
|
pip:
|
||||||
pip3 install -r {{ sourcedir }}/requirements.txt
|
extra_args: "{{ extra_args | default('') }} {% if upper_constraints_file %}-c {{ upper_constraints_file }}{% endif %}"
|
||||||
{{ extra_args | default('') }}
|
requirements: "{{ sourcedir }}/requirements.txt"
|
||||||
{% if upper_constraints_file %}-c {{ upper_constraints_file }}{% endif %}
|
|
||||||
register: pip_package_install_done
|
register: pip_package_install_done
|
||||||
until: pip_package_install_done is succeeded
|
until: pip_package_install_done is succeeded
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
@@ -61,4 +61,4 @@ keystone:
|
|||||||
password: ChangeThisPa55w0rd
|
password: ChangeThisPa55w0rd
|
||||||
host: localhost
|
host: localhost
|
||||||
|
|
||||||
pip_opts: "--upgrade-strategy only-if-needed"
|
pip_opts: "{{ lookup('env', 'PIP_OPTS') | default('') }}"
|
||||||
|
|||||||
@@ -156,7 +156,17 @@ PYTHON=$(which python3)
|
|||||||
# requests, one of our indirect dependencies (bug 1459947).
|
# requests, one of our indirect dependencies (bug 1459947).
|
||||||
#
|
#
|
||||||
ls $PYTHON
|
ls $PYTHON
|
||||||
sudo -H -E $PYTHON -m pip install -U pip --ignore-installed
|
|
||||||
|
# workaround for PEP517 issue
|
||||||
|
PYTHON_VER=$($PYTHON -V)
|
||||||
|
if [[ $PYTHON_VER == "Python 3.6.8" ]]; then
|
||||||
|
sudo -H -E $PYTHON -m pip install pip==19.0 --ignore-installed
|
||||||
|
export PIP_OPTS=""
|
||||||
|
else
|
||||||
|
sudo -H -E $PYTHON -m pip install -U pip --ignore-installed
|
||||||
|
export PIP_OPTS="--upgrade-strategy only-if-needed"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$?" != "0" ]; then
|
if [ "$?" != "0" ]; then
|
||||||
wget -O /tmp/get-pip.py https://bootstrap.pypa.io/3.4/get-pip.py
|
wget -O /tmp/get-pip.py https://bootstrap.pypa.io/3.4/get-pip.py
|
||||||
sudo -H -E ${PYTHON} /tmp/get-pip.py
|
sudo -H -E ${PYTHON} /tmp/get-pip.py
|
||||||
|
|||||||
Reference in New Issue
Block a user