From c85daf27f4a969664926c56a19028c17f3be8c01 Mon Sep 17 00:00:00 2001 From: "Mikhail f. Shiryaev" Date: Tue, 27 Feb 2024 12:46:51 +0100 Subject: [PATCH] Replace deprecated distutils by vendored packaging --- tests/ci/compatibility_check.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/ci/compatibility_check.py b/tests/ci/compatibility_check.py index a2e6c94cf48..b2e3686f813 100644 --- a/tests/ci/compatibility_check.py +++ b/tests/ci/compatibility_check.py @@ -4,10 +4,14 @@ import argparse import logging import subprocess import sys -from distutils.version import StrictVersion from pathlib import Path from typing import List, Tuple +# isort: off +from pip._vendor.packaging.version import Version + +# isort: on + from build_download_helper import download_builds_filter from docker_images_helper import DockerImage, get_docker_image, pull_image from env_helper import REPORT_PATH, TEMP_PATH @@ -38,7 +42,7 @@ def process_glibc_check(log_path: Path, max_glibc_version: str) -> TestResults: _, version = symbol_with_glibc.split("@GLIBC_") if version == "PRIVATE": test_results.append(TestResult(symbol_with_glibc, "FAIL")) - elif StrictVersion(version) > max_glibc_version: + elif Version(version) > Version(max_glibc_version): test_results.append(TestResult(symbol_with_glibc, "FAIL")) if not test_results: test_results.append(TestResult("glibc check", "OK"))