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

Steve Kowalik notifications at github.com
Mon Oct 12 23:41:00 UTC 2020


@s-t-e-v-e-n-k commented on this pull request.



> +    @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()

Ah, good point! staticmethod makes much more sense.

-- 
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#discussion_r503586786
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20201012/c1ad91dd/attachment.html>


More information about the Rpm-maint mailing list