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 # Generate a list of 'pip' packages pre-build/post-build
16 # During post-build, perform a diff on the two lists and copy files to archive directory
17 echo "Listing pip packages"
18 pip_list_pre=/tmp/pip-list-pre.txt
19 pip_list_post=/tmp/pip-list-post.txt
20 pip_list_diffs=/tmp/pip-list-diffs.txt
21 if [[ -f $pip_list_pre ]]; then
22 pip list > $pip_list_post
23 echo "Compare pip packages before/after..."
24 if diff --suppress-common-lines $pip_list_pre $pip_list_post \
25 | tee $pip_list_diffs; then
26 echo "No diffs" | tee $pip_list_diffs
28 mkdir -p $WORKSPACE/archives
29 cp $pip_list_pre $pip_list_post $pip_list_diffs $WORKSPACE/archives
30 rm -rf $pip_list_pre $pip_list_post $pip_list_diffs
31 ls $WORKSPACE/archives
32 # Would just like to 'exit 0' here but we can't because the
33 # log-deploy.sh script is 'appended' to this file and it would not
36 pip list > $pip_list_pre
37 # These 'pip installs' only need to be executed during pre-build
39 requirements_file=$(mktemp /tmp/requirements-XXXX.txt)
41 # Note: To test lftools master branch change the lftools configuration below in
42 # the requirements file from "lftools[openstack]~=#.##.#" to
43 # git+https://github.com/lfit/releng-lftools.git#egg=lftools[openstack]
45 echo "Generating Requirements File"
46 cat << 'EOF' > "$requirements_file"
47 lftools[openstack]~=0.25.1
48 python-heatclient~=1.16.1
49 python-openstackclient~=3.16.0
50 dogpile.cache~=0.6.8 # Version 0.7.[01] seems to break openstackclient
51 niet~=1.4.2 # Extract values from yaml
55 # Use `python -m pip` to ensure we are using the latest version of pip
56 python -m pip install --user --quiet --upgrade pip
57 python -m pip install --user --quiet --upgrade setuptools
58 python -m pip install --user --quiet --upgrade -r "$requirements_file"
59 rm -rf $requirements_file