From fe7b781c2039383761c0cf6530367ca83eb0ae17 Mon Sep 17 00:00:00 2001 From: Jonghwa Lee Date: Tue, 26 Nov 2024 17:17:53 +0900 Subject: [PATCH] [tools/mec] Fix the NOX to use the latest package (#14367) If there're multiple versions of package in the dist directory, the NOX used the oldest version. So, it fixes the NOX script to find the latest version even if there're multiple packages. ONE-DCO-1.0-Signed-off-by: Jonghwa Lee --- tools/model_explorer_circle/noxfile.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/model_explorer_circle/noxfile.py b/tools/model_explorer_circle/noxfile.py index 3738621d64b..64c37c4a1b1 100644 --- a/tools/model_explorer_circle/noxfile.py +++ b/tools/model_explorer_circle/noxfile.py @@ -36,7 +36,11 @@ def tests(session): build_and_check_dists(session) generated_files = os.listdir("dist/") - generated_sdist = os.path.join("dist/", generated_files[1]) + # Sort files in descending order according to the version + generated_files.sort( + key=lambda x: [int(i, 10) for i in x.split('-')[1].split('.')[:3]], reverse=True) + # The sdist file 'model_explorer_circle.x.x.x.tar.gz' would be used + generated_sdist = os.path.join("dist/", generated_files[0]) session.install(generated_sdist)