From ad62cc34801acc0c89ee7b50a57a7d6ac356ca80 Mon Sep 17 00:00:00 2001 From: Shiny Hou Date: Fri, 3 May 2024 18:47:36 +0800 Subject: [PATCH] chore: change distutils to packaging --- airtest/core/settings.py | 4 ++-- requirements.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/airtest/core/settings.py b/airtest/core/settings.py index 2d6042e1..9f0ad2d9 100644 --- a/airtest/core/settings.py +++ b/airtest/core/settings.py @@ -2,7 +2,7 @@ from airtest.utils.resolution import cocos_min_strategy import os import cv2 -from distutils.version import LooseVersion +from packaging.version import Version, parse class Settings(object): @@ -13,7 +13,7 @@ class Settings(object): RESIZE_METHOD = staticmethod(cocos_min_strategy) # keypoint matching: kaze/brisk/akaze/orb, contrib: sift/surf/brief CVSTRATEGY = ["mstpl", "tpl", "sift", "brisk"] - if LooseVersion('3.4.2') < LooseVersion(cv2.__version__) < LooseVersion('4.4.0'): + if Version('3.4.2') < parse(cv2.__version__) < Version('4.4.0'): CVSTRATEGY = ["mstpl", "tpl", "brisk"] KEYPOINT_MATCHING_PREDICTION = True THRESHOLD = 0.7 # [0, 1] diff --git a/requirements.txt b/requirements.txt index 5f93f495..a7c600f0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ filelock ffmpeg-python tidevice psutil +packaging