2 # SPDX-License-Identifier: EPL-1.0
3 ##############################################################################
4 # Copyright (c) 2018 The Linux Foundation and others.
6 # All rights reserved. This program and the accompanying materials
7 # are made available under the terms of the Eclipse Public License v1.0
8 # which accompanies this distribution, and is available at
9 # http://www.eclipse.org/legal/epl-v10.html
10 ##############################################################################
11 echo "---> python-tools-install.sh"
15 # This script will typically be called during pre-build & post-build.
16 # Create the user venv during pre-build.
17 if [[ ! -f /tmp/pre-build-complete ]]; then
18 requirements_file=$(mktemp /tmp/requirements-XXXX.txt)
20 # Note: To test lftools master branch change the lftools configuration below in
21 # the requirements file from "lftools[openstack]~=#.##.#" to
22 # git+https://github.com/lfit/releng-lftools.git#egg=lftools[openstack]
24 echo "Generating Requirements File"
25 cat << 'EOF' > "$requirements_file"
28 python-openstackclient
32 tox>=3.7.0 # Tox 3.7 or greater is necessary for parallel mode support
36 # Use `python -m pip` to ensure we are using pip from user venv
37 python3 -m venv ~/.local
38 python3 -m pip install --user --quiet --upgrade pip
39 python3 -m pip install --user --quiet --no-warn-script-location --upgrade setuptools
40 python3 -m pip install --user --quiet --no-warn-script-location --upgrade --upgrade-strategy eager -r "$requirements_file"
41 rm -rf "$requirements_file"
42 touch /tmp/pre-build-complete