Igor Gnatenko 7cf326
From 2f51022e1586a9b3ac8036b23995074b00910475 Mon Sep 17 00:00:00 2001
Igor Gnatenko 7cf326
From: Igor Gnatenko <ignatenko@redhat.com>
Igor Gnatenko 7cf326
Date: Mon, 22 Aug 2016 12:55:50 +0200
Igor Gnatenko 7cf326
Subject: [PATCH 2/3] pythondistdeps.py: show warning if version is not found
Igor Gnatenko 7cf326
 in metadata
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
In 49197c930bb6090d0fca4089ea75ec9d10e62f99 we introduced skipping
Igor Gnatenko 7cf326
metadata which has no version, but it's better to show some warning.
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
Signed-off-by: Igor Gnatenko <ignatenko@redhat.com>
Igor Gnatenko 7cf326
---
Igor Gnatenko 7cf326
 scripts/pythondistdeps.py | 1 +
Igor Gnatenko 7cf326
 1 file changed, 1 insertion(+)
Igor Gnatenko 7cf326
Igor Gnatenko 7cf326
diff --git a/scripts/pythondistdeps.py b/scripts/pythondistdeps.py
Igor Gnatenko 7cf326
index 54905c3..d7226e0 100755
Igor Gnatenko 7cf326
--- a/scripts/pythondistdeps.py
Igor Gnatenko 7cf326
+++ b/scripts/pythondistdeps.py
Igor Gnatenko 7cf326
@@ -110,6 +110,7 @@ for f in files:
Igor Gnatenko 7cf326
         dist = Distribution.from_location(path_item, dist_name, metadata)
Igor Gnatenko 7cf326
         # Check if py_version is defined in the file
Igor Gnatenko 7cf326
         if not dist.py_version:
Igor Gnatenko 7cf326
+            warnings.warn("Version for {!r} has not been found".format(dist), RuntimeWarning)
Igor Gnatenko 7cf326
             continue
Igor Gnatenko 7cf326
         if (Provides_PyMajorVer_Variant or legacy_Provides or legacy) and Provides:
Igor Gnatenko 7cf326
             # Get the Python major version
Igor Gnatenko 7cf326
-- 
Igor Gnatenko 7cf326
2.9.3
Igor Gnatenko 7cf326