Skip to content

Commit

Permalink
Remove unused dependency_links variables in freeze.py.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjerdonek committed Oct 16, 2018
1 parent ddfe130 commit 46ffb13
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions src/pip/_internal/operations/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os
import re

from pip._vendor import pkg_resources, six
from pip._vendor import six
from pip._vendor.packaging.utils import canonicalize_name
from pip._vendor.pkg_resources import RequirementParseError

Expand Down Expand Up @@ -34,27 +34,14 @@ def freeze(
if skip_regex:
skip_match = re.compile(skip_regex).search

dependency_links = []

for dist in pkg_resources.working_set:
if dist.has_metadata('dependency_links.txt'):
dependency_links.extend(
dist.get_metadata_lines('dependency_links.txt')
)
for link in find_links:
if '#egg=' in link:
dependency_links.append(link)
for link in find_links:
yield '-f %s' % link
installations = {}
for dist in get_installed_distributions(local_only=local_only,
skip=(),
user_only=user_only):
try:
req = FrozenRequirement.from_dist(
dist,
dependency_links
)
req = FrozenRequirement.from_dist(dist)
except RequirementParseError:
logger.warning(
"Could not parse requirement: %s",
Expand Down Expand Up @@ -156,7 +143,7 @@ def freeze(
yield str(installation).rstrip()


def get_requirement_info(dist, dependency_links):
def get_requirement_info(dist):
"""
Compute and return values (req, editable, comments) for use in
FrozenRequirement.from_dist().
Expand Down Expand Up @@ -208,8 +195,8 @@ def __init__(self, name, req, editable, comments=()):
self.comments = comments

@classmethod
def from_dist(cls, dist, dependency_links):
req, editable, comments = get_requirement_info(dist, dependency_links)
def from_dist(cls, dist):
req, editable, comments = get_requirement_info(dist)
if req is None:
req = dist.as_requirement()

Expand Down

0 comments on commit 46ffb13

Please sign in to comment.