[docker-ptf]: Upgrade ptf-py3 to 0.10.0 (#18263)

ptf-py3 0.9.3 couldn't compile on bookworm
Update ptf-py3 to latest release.

How to verify it
Verify the build and installation is successful in bookworm, buster and bullseye environment
Test docker-ptf.gz is built properly.
Ran sonic-mgmt tests with this docker-ptf.gz


Signed-off-by: Vivek Reddy Karri <vkarri@nvidia.com>
This commit is contained in:
Vivek 2024-03-08 08:55:58 -08:00 committed by GitHub
parent f10220d428
commit a46a7483c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 32 additions and 5 deletions

View File

@ -2,7 +2,7 @@
SPATH := $($(PTF_PY3)_SRC_PATH)
DEP_FILES := $(SONIC_COMMON_FILES_LIST) rules/ptf-py3.mk rules/ptf-py3.dep
DEP_FILES += $(SONIC_COMMON_BASE_FILES_LIST)
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && git ls-files))
SMDEP_FILES := $(addprefix $(SPATH)/,$(shell cd $(SPATH) && find . -type f -exec sh -c 'git ls-files --error-unmatch "$0" >/dev/null 2>&1' {} \; -printf '%P\n'))
$(PTF_PY3)_CACHE_MODE := GIT_CONTENT_SHA
$(PTF_PY3)_DEP_FLAGS := $(SONIC_COMMON_FLAGS_LIST)

View File

@ -1,6 +1,6 @@
# ptf package
PTF_PY3 = ptf-0.9.3-py3-none-any.whl
PTF_PY3 = ptf-0.10.0.post0-py3-none-any.whl
$(PTF_PY3)_SRC_PATH = $(SRC_PATH)/ptf-py3
$(PTF_PY3)_PYTHON_VERSION = 3
$(PTF_PY3)_TEST = n

View File

@ -68,7 +68,7 @@ RUN pip3 install virtualenv
RUN mkdir /python_virtualenv
RUN cd /python_virtualenv && python3 -m virtualenv --copies -p /usr/bin/python3 env3
RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install setuptools==66.1.1 wheel==0.38.4 fastentrypoints pytest pytest-cov pytest-runner==5.2 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 PyYAML==6.0.1 redis==3.5.3 pexpect==4.8.0 Pympler==0.8 parameterized natsort==6.2.1 MarkupSafe==2.0.1 Jinja2==3.0.3 click tabulate netaddr netifaces pyroute2 pyfakefs sphinx && ln -s /python_virtualenv/env3/bin/pytest /python_virtualenv/env3/bin/pytest-3
RUN PATH=/python_virtualenv/env3/bin/:$PATH pip3 install setuptools==66.1.1 setuptools-scm==8.0.4 setuptools-scm-git-archive==1.4.1 wheel==0.38.4 fastentrypoints pytest pytest-cov pytest-runner==5.2 nose==1.3.7 mockredispy==2.9.3 mock==3.0.5 PyYAML==6.0.1 redis==3.5.3 pexpect==4.8.0 Pympler==0.8 parameterized natsort==6.2.1 MarkupSafe==2.0.1 Jinja2==3.0.3 click tabulate netaddr netifaces pyroute2 pyfakefs sphinx && ln -s /python_virtualenv/env3/bin/pytest /python_virtualenv/env3/bin/pytest-3
RUN apt-get --fix-broken install -y
RUN LIBPYTHON3_DEPS="`apt-cache depends libpython3-dev:$arch |grep Depends|awk {'print \$2;'}|tr "\n" " "`" && apt-get install -y libpython2.7-dev:$arch $LIBPYTHON3_DEPS libxml2-dev:$arch libxslt-dev:$arch libssl-dev:$arch libz-dev:$arch
@ -510,6 +510,9 @@ RUN pip3 install pyang==2.4.0
# For mgmt-framework build
RUN pip3 install mmh3==2.5.1
# For ptf-py3 0.10.0
RUN pip3 install setuptools==66.1.1 setuptools-scm==8.0.4 setuptools-scm-git-archive==1.4.1
RUN apt-get install -y xsltproc
# Install dependencies for isc-dhcp-relay build

@ -1 +1 @@
Subproject commit 405513bcad2eae3092b0ac4ceb31e8dec5e32311
Subproject commit 978598dd04434b5270495ac0c6466eb2c6c752f5

View File

@ -0,0 +1,23 @@
From 5e46050967f5c29c6572b318d9aebb184f8275cf Mon Sep 17 00:00:00 2001
From: Vivek Reddy <vkarri@nvidia.com>
Date: Wed, 21 Feb 2024 19:04:40 +0000
Subject: [PATCH] Avoid local version scheme by setuptools-scm
Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
---
pyproject.toml | 1 +
1 file changed, 1 insertion(+)
diff --git a/pyproject.toml b/pyproject.toml
index 74a5350..33af092 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -11,4 +11,5 @@ build-backend = 'setuptools.build_meta'
root = "./"
# use current tag and not next one
version_scheme = "post-release"
+local_scheme = "no-local-version"
write_to = "src/ptf/_version.py"
--
2.17.1

View File

@ -1,2 +1,3 @@
0001-Remove-ord-in-get_mac-to-avoid-TypeError.patch
0002-Fill-byte-formatted-client-mac-address-in-DHCP-Disco.patch
0002-Fill-byte-formatted-client-mac-address-in-DHCP-Disco.patch
0003-Avoid-local-version-scheme-by-setuptools-scm.patch