Skip to content

Commit 6a6fa27

Browse files
author
Samuel Moors
committed
add close matches
1 parent 4820b85 commit 6a6fa27

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

easybuild/easyblocks/p/python.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
@author: Jens Timmerman (Ghent University)
3333
@author: Bart Oldeman (McGill University, Calcul Quebec, Compute Canada)
3434
"""
35+
import difflib
3536
import glob
3637
import json
3738
import os
@@ -202,7 +203,9 @@ def run_pip_list(pkgs, python_cmd=None):
202203

203204
for name, version in pkgs:
204205
if name not in pip_pkgs:
205-
missing_names.append(name)
206+
close_matches = difflib.get_close_matches(name, pip_pkgs.keys())
207+
missing_names.append(f'{name} (close matches: {close_matches})')
208+
206209
elif version != pip_pkgs[name]:
207210
missing_versions.append(f'{name}-{version} (pip list version: {pip_pkgs[name]})')
208211

0 commit comments

Comments
 (0)