[Rpm-maint] [rpm-software-management/rpm] pythondistdeps: Switch to importlib.metadata (#1317)

torsava notifications at github.com
Mon Oct 12 12:08:02 UTC 2020


@torsava commented on this pull request.

Besides the two mostly cosmetic comments, I think it looks good!

> @@ -142,9 +210,23 @@ def convert(name, operator, version_id):
 
 
 def normalize_name(name):

This function is now completely unused and can be removed.

> +    @classmethod
+    def normalize_name(klass, name):
+        """https://www.python.org/dev/peps/pep-0503/#normalized-names"""
+        return re.sub(r'[-_.]+', '-', name).lower()
+
+    @classmethod
+    def legacy_normalize_name(klass, name):
+        """Like pkg_resources Distribution.key property"""
+        return re.sub(r'[-_]+', '-', name).lower()

Nitpick: I'm not excited about the `klass` name instead of the standard `cls`.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1317#pullrequestreview-506555419
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201012/15a604e6/attachment.html>


More information about the Rpm-maint mailing list