File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 1616 print ('pkg_resources could not be imported: %s\n You might need to install setuptools!' % e )
1717 sys .exit (1 )
1818
19+ try :
20+ from packaging .utils import canonicalize_name
21+ except ImportError :
22+ _canonicalize_regex = re .compile (r"[-_.]+" )
23+
24+ def canonicalize_name (name ):
25+ return _canonicalize_regex .sub ("-" , name ).lower ()
26+
1927
2028@contextmanager
2129def temporary_directory (* args , ** kwargs ):
@@ -87,6 +95,7 @@ def find_deps(pkgs, dep_tree):
8795 """Recursively resolve dependencies of the given package(s) and return them"""
8896 res = []
8997 for pkg in pkgs :
98+ pkg = canonicalize_name (pkg )
9099 matching_entries = [entry for entry in dep_tree
91100 if pkg in (entry ['package' ]['package_name' ], entry ['package' ]['key' ])]
92101 if not matching_entries :
You can’t perform that action at this time.
0 commit comments