From 7b4f699503f1dd235267015d0f7646ec8d2a3066 Mon Sep 17 00:00:00 2001 From: Sangita Maity Date: Fri, 13 Dec 2019 10:32:20 -0800 Subject: [PATCH] Click Upgrade to 7.0.0 (#20) Signed-off-by: Sangita Maity --- .gitignore | 2 -- .../build_templates/sonic_debian_extension.j2 | 4 +-- rules/python-click.mk | 17 ------------ slave.mk | 1 - sonic-slave-jessie/Dockerfile.j2 | 2 +- sonic-slave-stretch/Dockerfile.j2 | 2 +- src/python-click/Makefile | 26 ------------------- 7 files changed, 4 insertions(+), 50 deletions(-) delete mode 100644 rules/python-click.mk delete mode 100644 src/python-click/Makefile diff --git a/.gitignore b/.gitignore index 739454168796..a04a9f72994c 100644 --- a/.gitignore +++ b/.gitignore @@ -62,8 +62,6 @@ src/lm-sensors/* !src/lm-sensors/Makefile src/mpdecimal/* !src/mpdecimal/Makefile -src/python-click/* -!src/python-click/Makefile src/python3/* !src/python3/Makefile src/radvd/* diff --git a/files/build_templates/sonic_debian_extension.j2 b/files/build_templates/sonic_debian_extension.j2 index ed1281619896..829ca4b21d89 100644 --- a/files/build_templates/sonic_debian_extension.j2 +++ b/files/build_templates/sonic_debian_extension.j2 @@ -134,8 +134,8 @@ sudo rm -rf $FILESYSTEM_ROOT/$DAEMON_BASE_PY2_WHEEL_NAME # Install built Python Click package (and its dependencies via 'apt-get -y install -f') # Do this before installing sonic-utilities so that it doesn't attempt to install # an older version as part of its dependencies -sudo dpkg --root=$FILESYSTEM_ROOT -i $debs_path/python-click*_all.deb || \ - sudo LANG=C DEBIAN_FRONTEND=noninteractive chroot $FILESYSTEM_ROOT apt-get -y install -f +# Install click == 7.0.0 via pip in order to support autocompletion for breakout Mode in sonic-utilities +sudo https_proxy=$https_proxy LANG=C chroot $FILESYSTEM_ROOT pip install click==7.0.0 # Install python pexpect used by sonic-utilities consutil # using pip install instead to get a more recent version than is available through debian diff --git a/rules/python-click.mk b/rules/python-click.mk deleted file mode 100644 index 5d48dc30d604..000000000000 --- a/rules/python-click.mk +++ /dev/null @@ -1,17 +0,0 @@ -# python-click package -# -# Python Click versions < 6.7 have a bug which causes bash completion -# functionality to stop working after two sublevels. sonic-utilities depends -# on this package, and the most recent version provided by Debian Jessie and -# Stretch is v6.6. We build version 6.7 from source in order to fix this bug. -# TODO: If we upgrade to a distro which provides a version >= 6.7 we will no -# longer need to build this. - -PYTHON_CLICK_VERSION = 6.7-4 - -export PYTHON_CLICK_VERSION - -PYTHON_CLICK = python-click_$(PYTHON_CLICK_VERSION)_all.deb -$(PYTHON_CLICK)_SRC_PATH = $(SRC_PATH)/python-click -SONIC_MAKE_DEBS += $(PYTHON_CLICK) -SONIC_STRETCH_DEBS += $(PYTHON_CLICK) diff --git a/slave.mk b/slave.mk index e1d094dadfb6..b1774e705278 100644 --- a/slave.mk +++ b/slave.mk @@ -613,7 +613,6 @@ $(addprefix $(TARGET_PATH)/, $(SONIC_INSTALLERS)) : $(TARGET_PATH)/% : \ $(addprefix $(STRETCH_DEBS_PATH)/,$(INITRAMFS_TOOLS) \ $(LINUX_KERNEL) \ $(SONIC_DEVICE_DATA) \ - $(PYTHON_CLICK) \ $(IFUPDOWN2) \ $(KDUMP_TOOLS) \ $(LIBPAM_TACPLUS) \ diff --git a/sonic-slave-jessie/Dockerfile.j2 b/sonic-slave-jessie/Dockerfile.j2 index c082acc9e2b8..686bc39bc1d0 100644 --- a/sonic-slave-jessie/Dockerfile.j2 +++ b/sonic-slave-jessie/Dockerfile.j2 @@ -307,7 +307,7 @@ RUN pip install --force-reinstall --upgrade "jinja2>=2.10" RUN pip install j2cli==0.3.10 # For sonic utilities testing -RUN pip install click-default-group click natsort tabulate netifaces==0.10.7 fastentrypoints +RUN pip install click-default-group click==7.0.0 natsort tabulate netifaces==0.10.7 fastentrypoints # For supervisor build RUN pip install meld3 mock diff --git a/sonic-slave-stretch/Dockerfile.j2 b/sonic-slave-stretch/Dockerfile.j2 index 311c38ce5218..495a406e51e9 100644 --- a/sonic-slave-stretch/Dockerfile.j2 +++ b/sonic-slave-stretch/Dockerfile.j2 @@ -331,7 +331,7 @@ RUN pip install j2cli==0.3.10 # Remove python-click 6.6 RUN apt-get purge -y python-click # For sonic utilities testing -RUN pip install click-default-group click natsort tabulate netifaces==0.10.7 fastentrypoints +RUN pip install click-default-group click==7.0.0 natsort tabulate netifaces==0.10.7 fastentrypoints # For sonic snmpagent mock testing RUN pip3 install mockredispy==2.9.3 diff --git a/src/python-click/Makefile b/src/python-click/Makefile deleted file mode 100644 index 4deb27257fd2..000000000000 --- a/src/python-click/Makefile +++ /dev/null @@ -1,26 +0,0 @@ -.ONESHELL: -SHELL = /bin/bash -.SHELLFLAGS += -e - -MAIN_TARGET = python-click_$(PYTHON_CLICK_VERSION)_all.deb - -$(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : - # Remove any stale files - rm -rf ./python-click - - # Clone python-click Debian repo - git clone https://salsa.debian.org/debian/python-click - - pushd ./python-click - - # Reset HEAD to the commit of the proper tag - # NOTE: Using "git checkout " here detaches our HEAD, - # which stg doesn't like, so we use this method instead - git reset --hard debian/$(PYTHON_CLICK_VERSION) - - # Build source and Debian packages - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) - popd - - # Move the newly-built .deb package to the destination directory - mv $* $(DEST)/