Browse Source

scanpypi: get rid of commented lines and also strip the package strings

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Yegor Yefremov 6 years ago
parent
commit
d2e29fccdf
1 changed files with 4 additions and 0 deletions
  1. 4 0
      utils/scanpypi

+ 4 - 0
utils/scanpypi

@@ -293,6 +293,10 @@ class BuildrootPackage():
         self.pkg_req = self.setup_metadata['install_requires']
         self.pkg_req = [re.sub('([-.\w]+).*', r'\1', req)
                         for req in self.pkg_req]
+
+        # get rid of commented lines and also strip the package strings
+        self.pkg_req = [item.strip() for item in self.pkg_req if item[0] != '#']
+
         req_not_found = self.pkg_req
         self.pkg_req = map(pkg_buildroot_name, self.pkg_req)
         pkg_tuples = zip(req_not_found, self.pkg_req)