@torsava commented on this pull request.


>  from warnings import warn
 
+try:
+    from importlib.metadata import PathDistribution
+except ImportError:
+    from importlib_metadata import PathDistribution
+
+try:
+    from pathlib import Path
+except ImportError:
+    from pathlib2 import Path
+
+
+class Req(Requirement):
+    @property
+    def key(self):
+        return self.name.lower().replace('_', '-')

To clarify a possible confusion, I think `key` always returned the same thing. 
But this script had two modes, in legacy mode it used the `key` value, and in 
pep503 mode it used the `normalize_name` function.

So yes, there are two different methods to convert the name, but that is 
handled by this script, not by `Requirement.key`.

-- 
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_r494230415
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to