diff --git a/scripts/pythondistdeps.py b/scripts/pythondistdeps.py index 8a2f43dc21..76017f3942 100755 --- a/scripts/pythondistdeps.py +++ b/scripts/pythondistdeps.py @@ -89,14 +89,12 @@ lower_dir = dirname(lower) if lower_dir.endswith('.egg') or \ lower_dir.endswith('.egg-info') or \ - lower_dir.endswith('.egg-link') or \ lower_dir.endswith('.dist-info'): lower = lower_dir f = dirname(f) # Determine provide, requires, conflicts & recommends based on egg/dist metadata if lower.endswith('.egg') or \ lower.endswith('.egg-info') or \ - lower.endswith('.egg-link') or \ lower.endswith('.dist-info'): # This import is very slow, so only do it if needed from pkg_resources import Distribution, FileMetadata, PathMetadata @@ -108,6 +106,10 @@ path_item = f metadata = FileMetadata(f) dist = Distribution.from_location(path_item, dist_name, metadata) + # Check if py_version is defined in the file + if not dist.py_version: + warnings.warn("Version for {!r} has not been found".format(dist), RuntimeWarning) + continue if (Provides_PyMajorVer_Variant or legacy_Provides or legacy) and Provides: # Get the Python major version pyver_major = dist.py_version.split('.')[0]