Make get_requirement_info() a function rather than a class method.
@@ -156,15 +156,7 @@ def freeze(
yield str(installation).rstrip()
-class FrozenRequirement(object):
- def __init__(self, name, req, editable, comments=()):
- self.name = name
- self.req = req
- self.editable = editable
- self.comments = comments
-
- @classmethod
- def get_requirement_info(cls, dist, dependency_links):
+def get_requirement_info(dist, dependency_links):
"""
Compute and return values (req, editable, comments) for use in
FrozenRequirement.from_dist().
@@ -207,11 +199,17 @@ class FrozenRequirement(object):
return (None, False, comments)
+
+class FrozenRequirement(object):
+ def __init__(self, name, req, editable, comments=()):
+ self.name = name
+ self.req = req
+ self.editable = editable
+ self.comments = comments
+
@classmethod
def from_dist(cls, dist, dependency_links):
- req, editable, comments = cls.get_requirement_info(
- dist, dependency_links
- )
+ req, editable, comments = get_requirement_info(dist, dependency_links)
if req is None:
req = dist.as_requirement()
