build-wheel-cache: Don't use virtualenv on python3 platforms
As noted inline, platforms are starting to decide to deprecate virtualenv for "python3 -m venv". Put in logic to use venv in our Python 3 paths. Change-Id: I46778642647d7be995d476fb567a9943cae66b8f
This commit is contained in:
parent
1f9d9b40f5
commit
d1fd2e556c
@ -8,6 +8,15 @@ LOGS=$(pwd)/logs
|
|||||||
|
|
||||||
FAIL_LOG=${LOGS}/failed.txt
|
FAIL_LOG=${LOGS}/failed.txt
|
||||||
|
|
||||||
|
# NOTE(ianw) : Some Python 3 platforms (>= 9-stream) are deprecating
|
||||||
|
# virtualenv. When we finally ditch Python 2 platforms, just use
|
||||||
|
# python3 -m venv everywhere.
|
||||||
|
if [[ ${PYTHON_VERSION} =~ python2 ]]; then
|
||||||
|
VIRTUALENV_CMD="virtualenv -p $PYTHON_VERSION"
|
||||||
|
else
|
||||||
|
VIRTUALENV_CMD="${PYTHON_VERSION} -m venv"
|
||||||
|
fi
|
||||||
|
|
||||||
# preclean logs
|
# preclean logs
|
||||||
mkdir -p ${LOGS}
|
mkdir -p ${LOGS}
|
||||||
rm -rf ${LOGS}/*
|
rm -rf ${LOGS}/*
|
||||||
@ -44,7 +53,7 @@ for BRANCH in master $BRANCHES; do
|
|||||||
# setup the building virtualenv. We want to freshen this for each
|
# setup the building virtualenv. We want to freshen this for each
|
||||||
# branch.
|
# branch.
|
||||||
rm -rf build_env
|
rm -rf build_env
|
||||||
virtualenv -p $PYTHON_VERSION build_env
|
${VIRTUALENV_CMD} build_env
|
||||||
|
|
||||||
build_env/bin/pip install --upgrade pip
|
build_env/bin/pip install --upgrade pip
|
||||||
|
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
- name: Ensure virtualenv dependency
|
- name: Ensure virtualenv dependency
|
||||||
include_role:
|
include_role:
|
||||||
name: ensure-virtualenv
|
name: ensure-virtualenv
|
||||||
|
when: wheel_python == "python2"
|
||||||
|
|
||||||
|
# NOTE(ianw) : 2022-02-08 - on python3 we use -m venv; ensure-pip will
|
||||||
|
# set this up for us. Remove above and the conditional here when we
|
||||||
|
# drop python2 platforms.
|
||||||
|
- name: Ensure pip
|
||||||
|
include_role:
|
||||||
|
name: ensure-pip
|
||||||
|
when: wheel_python == "python3"
|
||||||
|
|
||||||
- name: Ensure wheel dir exists
|
- name: Ensure wheel dir exists
|
||||||
file:
|
file:
|
||||||
|
Loading…
Reference in New Issue
Block a user