From e2609b82bb45907dd4b19934db081f268692378c Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Fri, 12 Jun 2020 17:21:08 -0400 Subject: [PATCH] Consolidate py2 and py3 requirements files Consolidate all py2 and py3 requirements into a single requirements.txt file for each and pip install them in a single `pip install`. The problem with running multiple pip installs separately is that Python dependency resolution will not take into account previous pip installs and can break package dependencies. Crafting a requirements.txt and installing all packages at the same time allows pip to ensure that all packages are installed together with dependency versions that statisfy all requirements. Now that only Python 3 is supported we can combine everything into a single requirements.txt file. Change-Id: I020ac24da62301c2d99645d5adae9b45f642cb75 Signed-off-by: Thanh Ha --- .../integration-install-robotframework.sh | 46 +++++++++++-------- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/jjb/integration/integration-install-robotframework.sh b/jjb/integration/integration-install-robotframework.sh index ca169d746..b557e8da8 100644 --- a/jjb/integration/integration-install-robotframework.sh +++ b/jjb/integration/integration-install-robotframework.sh @@ -8,6 +8,7 @@ # which accompanies this distribution, and is available at # http://www.eclipse.org/legal/epl-v10.html ############################################################################## +# vim: sw=4 ts=4 sts=4 et ft=sh : ROBOT_VENV="/tmp/v/robot" echo ROBOT_VENV="${ROBOT_VENV}" >> "${WORKSPACE}/env.properties" @@ -22,39 +23,46 @@ source "${ROBOT_VENV}/bin/activate" set -exu # Make sure pip itself us up-to-date. -pip install --upgrade pip -python3 -m pip install --user --upgrade pip +python -m pip install --upgrade pip -pip install --upgrade docker-py importlib requests scapy netifaces netaddr ipaddr pyhocon -pip install --upgrade robotframework-httplibrary \ - requests==2.15.1 \ - robotframework-requests \ - robotframework-sshlibrary==3.1.1 \ - robotframework-selenium2library +echo "Installing Python Requirements" +cat << 'EOF' > "requirements.txt" +docker-py +importlib +ipaddr +netaddr +netifaces +pyhocon +requests +robotframework-httplibrary +robotframework-pycurllibrary +robotframework-requests +robotframework-selenium2library +robotframework-sshlibrary==3.1.1 +scapy # Module jsonpath is needed by current AAA idmlite suite. -pip install --upgrade jsonpath-rw +jsonpath-rw # Modules for longevity framework robot library -pip install --upgrade elasticsearch elasticsearch-dsl +elasticsearch +elasticsearch-dsl # Module for pyangbind used by lispflowmapping project -pip install --upgrade pyangbind +pyangbind # Module for iso8601 datetime format -pip install --upgrade isodate +isodate # Module for TemplatedRequests.robot library -pip install --upgrade jmespath +jmespath # Module for backup-restore support library -pip install --upgrade jsonpatch +jsonpatch # odltools for extra debugging -pip install odltools +odltools +EOF +python -m pip install -r requirements.txt odltools -V - -# Print installed versions. pip freeze - -# vim: sw=4 ts=4 sts=4 et ft=sh : -- 2.36.6