fix pattern (#1439)

This commit is contained in:
Wenyu.Li 2025-01-12 13:21:59 +08:00 committed by GitHub
parent 9578ce0820
commit 4ad1c8a238
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -233,7 +233,7 @@ def remap_pip_package(pkg):
def is_blacklisted(name):
name = name.strip()
pattern = r'([^<>!=]+)([<>!=]=?)([^ ]*)'
pattern = r'([^<>!~=]+)([<>!~=]=?)([^ ]*)'
match = re.search(pattern, name)
if match:
@ -248,7 +248,7 @@ def is_blacklisted(name):
if match is None:
if name in pips:
return True
elif match.group(2) in ['<=', '==', '<']:
elif match.group(2) in ['<=', '==', '<', '~=']:
if name in pips:
if manager_util.StrictVersion(pips[name]) >= manager_util.StrictVersion(match.group(3)):
return True
@ -262,7 +262,7 @@ def is_installed(name):
if name.startswith('#'):
return True
pattern = r'([^<>!=]+)([<>!=]=?)([0-9.a-zA-Z]*)'
pattern = r'([^<>!~=]+)([<>!~=]=?)([0-9.a-zA-Z]*)'
match = re.search(pattern, name)
if match:

View File

@ -413,7 +413,7 @@ def is_installed(name):
if name.startswith('#'):
return True
pattern = r'([^<>!=]+)([<>!=]=?)([0-9.a-zA-Z]*)'
pattern = r'([^<>!~=]+)([<>!~=]=?)([0-9.a-zA-Z]*)'
match = re.search(pattern, name)
if match: