From 6486ed207cb82279ec62a3e95a689b96f316bab1 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Mon, 18 Oct 2021 09:23:09 +0000 Subject: [PATCH 1/4] Use pip to install setup.py dependency instead of `python setup.py install` --- slave.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/slave.mk b/slave.mk index 093a31910596..8a853bedcf43 100644 --- a/slave.mk +++ b/slave.mk @@ -643,6 +643,7 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA pushd $($*_SRC_PATH) $(LOG_SIMPLE) # apply series of patches if exist if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi + pip$($*_PYTHON_VERSION) install . if [ ! "$($*_TEST)" = "n" ]; then python$($*_PYTHON_VERSION) setup.py test $(LOG); fi python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG) # clean up From 3c76d8c72def427b413bf94077717175ebc9d1e8 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 20 Oct 2021 06:06:00 +0000 Subject: [PATCH 2/4] Add sudo --- slave.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/slave.mk b/slave.mk index 8a853bedcf43..73b26c621b23 100644 --- a/slave.mk +++ b/slave.mk @@ -643,7 +643,7 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA pushd $($*_SRC_PATH) $(LOG_SIMPLE) # apply series of patches if exist if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi - pip$($*_PYTHON_VERSION) install . + sudo pip$($*_PYTHON_VERSION) install . if [ ! "$($*_TEST)" = "n" ]; then python$($*_PYTHON_VERSION) setup.py test $(LOG); fi python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG) # clean up From 99fbb6d338ab76bf1c0303380c46020b0a3b4502 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 20 Oct 2021 06:06:28 +0000 Subject: [PATCH 3/4] Revert "redis-dump-load: Pin the redis package to use 3.5.3 (#9001)" This reverts commit 6432b508d996c31cbca758fffded0af841de26be. --- .../0003-use-redis-3.5.3.patch | 25 ------------------- src/redis-dump-load.patch/series | 1 - 2 files changed, 26 deletions(-) delete mode 100644 src/redis-dump-load.patch/0003-use-redis-3.5.3.patch diff --git a/src/redis-dump-load.patch/0003-use-redis-3.5.3.patch b/src/redis-dump-load.patch/0003-use-redis-3.5.3.patch deleted file mode 100644 index a58c2059e81a..000000000000 --- a/src/redis-dump-load.patch/0003-use-redis-3.5.3.patch +++ /dev/null @@ -1,25 +0,0 @@ -Pin the redis package to version 3.5.3 (the last version that supports both -Python 2 and 3). - -Signed-off-by: Saikrishna Arcot - -diff --git a/requirements.txt b/requirements.txt -index 7800f0f..3fc0632 100644 ---- a/requirements.txt -+++ b/requirements.txt -@@ -1 +1 @@ --redis -+redis==3.5.3 -diff --git a/setup.py b/setup.py -index 8ccf31f..6db9ec4 100644 ---- a/setup.py -+++ b/setup.py -@@ -17,7 +17,7 @@ setup(name=package_name, - author_email='oleg@bsdpower.com', - url='http://github.com/p/redis-dump-load', - py_modules=['redisdl'], -- install_requires=['redis'], -+ install_requires=['redis==3.5.3'], - data_files=[ - (doc_dir, data_files), - ], diff --git a/src/redis-dump-load.patch/series b/src/redis-dump-load.patch/series index 50beb71a677f..c73c3b5caa97 100644 --- a/src/redis-dump-load.patch/series +++ b/src/redis-dump-load.patch/series @@ -1,3 +1,2 @@ 0001-Use-pipelines-when-dumping-52.patch 0002-Fix-setup.py-for-test-and-bdist_wheel.patch -0003-use-redis-3.5.3.patch From 29dfeea1f4ecc4c793d47ec4ca6f517582f62d50 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 20 Oct 2021 11:44:46 +0000 Subject: [PATCH 4/4] no sudo, remove non-existing file from sonic-yang-models setup.py --- slave.mk | 3 ++- src/sonic-yang-models/setup.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/slave.mk b/slave.mk index 73b26c621b23..c64237d62518 100644 --- a/slave.mk +++ b/slave.mk @@ -643,7 +643,8 @@ $(addprefix $(PYTHON_WHEELS_PATH)/, $(SONIC_PYTHON_WHEELS)) : $(PYTHON_WHEELS_PA pushd $($*_SRC_PATH) $(LOG_SIMPLE) # apply series of patches if exist if [ -f ../$(notdir $($*_SRC_PATH)).patch/series ]; then QUILT_PATCHES=../$(notdir $($*_SRC_PATH)).patch quilt push -a; fi - sudo pip$($*_PYTHON_VERSION) install . + # Use pip instead of later setup.py to install dependencies into user home, but uninstall self + pip$($*_PYTHON_VERSION) install . && pip$($*_PYTHON_VERSION) uninstall --yes `python setup.py --name` if [ ! "$($*_TEST)" = "n" ]; then python$($*_PYTHON_VERSION) setup.py test $(LOG); fi python$($*_PYTHON_VERSION) setup.py bdist_wheel $(LOG) # clean up diff --git a/src/sonic-yang-models/setup.py b/src/sonic-yang-models/setup.py index a5a74f1b4cba..7ef362c008ba 100644 --- a/src/sonic-yang-models/setup.py +++ b/src/sonic-yang-models/setup.py @@ -85,8 +85,7 @@ './yang-models/sonic-tc-queue-map.yang', './yang-models/sonic-pfc-priority-queue-map.yang', './yang-models/sonic-pfc-priority-priority-group-map.yang', - './yang-models/sonic-port-qos-map.yang', - './yang-models/sonic_yang_tree']), + './yang-models/sonic-port-qos-map.yang']), ], zip_safe=False, )