{"action":"created","comment":{"url":"https://api.github.com/repos/Yelp/pip-faster/pulls/comments/51775205","id":51775205,"diff_hunk":"@@ -301,66 +292,95 @@ def add_entry(self, entry):\n     return WorkingSetPlusEditableInstalls()\n \n \n+def req_cycle(req):\n+    \"\"\"is this requirement cyclic?\"\"\"\n+    cls = req.__class__\n+    name = req.name\n+    while isinstance(req.comes_from, cls):\n+        if name == req.comes_from.name:\n+            return True\n+        req = req.comes_from\n+    return False\n+\n+\n def pretty_req(req):\n     \"\"\"\n-    a context that makes the str() of a pip requirement a bit more readable,\n-    at the expense of munging its data temporarily\n+    return a copy of a pip requirement that is a bit more readable,\n+    at the expense of removing some of its data\n     \"\"\"\n-    return patched(vars(req), {'url': None, 'satisfied_by': None})\n+    from copy import copy\n+    req = copy(req)\n+    req.url = None\n+    req.satisfied_by = None\n+    return req\n \n \n def trace_requirements(requirements):\n     \"\"\"given an iterable of pip InstallRequirements,\n     return the set of required packages, given their transitive requirements.\n     \"\"\"\n+    requirements = tuple(pretty_req(r) for r in requirements)\n     working_set = fresh_working_set()\n \n     # breadth-first traversal:\n     from collections import deque\n     queue = deque(requirements)\n-    processed_reqs = set()\n-    errors = set()\n+    seen = set()\n+    errors = []\n     result = []\n     while queue:\n         req = queue.popleft()\n-        processed_reqs.add(req.name)\n+        req_id = str(req)  # InstallRequirement doesn't implement hash/equality, so we compare using str()","path":"pip_faster.py","position":113,"original_position":113,"commit_id":"72c2c633ede7db6ede612ab4071debfdb0c7004c","original_commit_id":"72c2c633ede7db6ede612ab4071debfdb0c7004c","user":{"login":"asottile","id":1810591,"avatar_url":"https://avatars.githubusercontent.com/u/1810591?v=3","gravatar_id":"","url":"https://api.github.com/users/asottile","html_url":"https://github.com/asottile","followers_url":"https://api.github.com/users/asottile/followers","following_url":"https://api.github.com/users/asottile/following{/other_user}","gists_url":"https://api.github.com/users/asottile/gists{/gist_id}","starred_url":"https://api.github.com/users/asottile/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asottile/subscriptions","organizations_url":"https://api.github.com/users/asottile/orgs","repos_url":"https://api.github.com/users/asottile/repos","events_url":"https://api.github.com/users/asottile/events{/privacy}","received_events_url":"https://api.github.com/users/asottile/received_events","type":"User","site_admin":false},"body":"wouldn't tuple(vars(...).items()) be better ?","created_at":"2016-02-03T19:40:51Z","updated_at":"2016-02-03T19:40:51Z","html_url":"https://github.com/Yelp/pip-faster/pull/110#discussion_r51775205","pull_request_url":"https://api.github.com/repos/Yelp/pip-faster/pulls/110","_links":{"self":{"href":"https://api.github.com/repos/Yelp/pip-faster/pulls/comments/51775205"},"html":{"href":"https://github.com/Yelp/pip-faster/pull/110#discussion_r51775205"},"pull_request":{"href":"https://api.github.com/repos/Yelp/pip-faster/pulls/110"}}},"pull_request":{"url":"https://api.github.com/repos/Yelp/pip-faster/pulls/110","id":58186662,"html_url":"https://github.com/Yelp/pip-faster/pull/110","diff_url":"https://github.com/Yelp/pip-faster/pull/110.diff","patch_url":"https://github.com/Yelp/pip-faster/pull/110.patch","issue_url":"https://api.github.com/repos/Yelp/pip-faster/issues/110","number":110,"state":"open","locked":false,"title":"improve circular dependency detection; simplify error messaging","user":{"login":"bukzor","id":640328,"avatar_url":"https://avatars.githubusercontent.com/u/640328?v=3","gravatar_id":"","url":"https://api.github.com/users/bukzor","html_url":"https://github.com/bukzor","followers_url":"https://api.github.com/users/bukzor/followers","following_url":"https://api.github.com/users/bukzor/following{/other_user}","gists_url":"https://api.github.com/users/bukzor/gists{/gist_id}","starred_url":"https://api.github.com/users/bukzor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bukzor/subscriptions","organizations_url":"https://api.github.com/users/bukzor/orgs","repos_url":"https://api.github.com/users/bukzor/repos","events_url":"https://api.github.com/users/bukzor/events{/privacy}","received_events_url":"https://api.github.com/users/bukzor/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-03T19:21:34Z","updated_at":"2016-02-03T19:40:51Z","closed_at":null,"merged_at":null,"merge_commit_sha":"008f1cd5195079ac717f6b0700a7c64a2489a2c7","assignee":{"login":"chriskuehl","id":665269,"avatar_url":"https://avatars.githubusercontent.com/u/665269?v=3","gravatar_id":"","url":"https://api.github.com/users/chriskuehl","html_url":"https://github.com/chriskuehl","followers_url":"https://api.github.com/users/chriskuehl/followers","following_url":"https://api.github.com/users/chriskuehl/following{/other_user}","gists_url":"https://api.github.com/users/chriskuehl/gists{/gist_id}","starred_url":"https://api.github.com/users/chriskuehl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chriskuehl/subscriptions","organizations_url":"https://api.github.com/users/chriskuehl/orgs","repos_url":"https://api.github.com/users/chriskuehl/repos","events_url":"https://api.github.com/users/chriskuehl/events{/privacy}","received_events_url":"https://api.github.com/users/chriskuehl/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/Yelp/pip-faster/pulls/110/commits","review_comments_url":"https://api.github.com/repos/Yelp/pip-faster/pulls/110/comments","review_comment_url":"https://api.github.com/repos/Yelp/pip-faster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Yelp/pip-faster/issues/110/comments","statuses_url":"https://api.github.com/repos/Yelp/pip-faster/statuses/72c2c633ede7db6ede612ab4071debfdb0c7004c","head":{"label":"bukzor:circular-depdendencies","ref":"circular-depdendencies","sha":"72c2c633ede7db6ede612ab4071debfdb0c7004c","user":{"login":"bukzor","id":640328,"avatar_url":"https://avatars.githubusercontent.com/u/640328?v=3","gravatar_id":"","url":"https://api.github.com/users/bukzor","html_url":"https://github.com/bukzor","followers_url":"https://api.github.com/users/bukzor/followers","following_url":"https://api.github.com/users/bukzor/following{/other_user}","gists_url":"https://api.github.com/users/bukzor/gists{/gist_id}","starred_url":"https://api.github.com/users/bukzor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bukzor/subscriptions","organizations_url":"https://api.github.com/users/bukzor/orgs","repos_url":"https://api.github.com/users/bukzor/repos","events_url":"https://api.github.com/users/bukzor/events{/privacy}","received_events_url":"https://api.github.com/users/bukzor/received_events","type":"User","site_admin":false},"repo":{"id":27938768,"name":"pip-faster","full_name":"bukzor/pip-faster","owner":{"login":"bukzor","id":640328,"avatar_url":"https://avatars.githubusercontent.com/u/640328?v=3","gravatar_id":"","url":"https://api.github.com/users/bukzor","html_url":"https://github.com/bukzor","followers_url":"https://api.github.com/users/bukzor/followers","following_url":"https://api.github.com/users/bukzor/following{/other_user}","gists_url":"https://api.github.com/users/bukzor/gists{/gist_id}","starred_url":"https://api.github.com/users/bukzor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bukzor/subscriptions","organizations_url":"https://api.github.com/users/bukzor/orgs","repos_url":"https://api.github.com/users/bukzor/repos","events_url":"https://api.github.com/users/bukzor/events{/privacy}","received_events_url":"https://api.github.com/users/bukzor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bukzor/pip-faster","description":"","fork":true,"url":"https://api.github.com/repos/bukzor/pip-faster","forks_url":"https://api.github.com/repos/bukzor/pip-faster/forks","keys_url":"https://api.github.com/repos/bukzor/pip-faster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bukzor/pip-faster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bukzor/pip-faster/teams","hooks_url":"https://api.github.com/repos/bukzor/pip-faster/hooks","issue_events_url":"https://api.github.com/repos/bukzor/pip-faster/issues/events{/number}","events_url":"https://api.github.com/repos/bukzor/pip-faster/events","assignees_url":"https://api.github.com/repos/bukzor/pip-faster/assignees{/user}","branches_url":"https://api.github.com/repos/bukzor/pip-faster/branches{/branch}","tags_url":"https://api.github.com/repos/bukzor/pip-faster/tags","blobs_url":"https://api.github.com/repos/bukzor/pip-faster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bukzor/pip-faster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bukzor/pip-faster/git/refs{/sha}","trees_url":"https://api.github.com/repos/bukzor/pip-faster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bukzor/pip-faster/statuses/{sha}","languages_url":"https://api.github.com/repos/bukzor/pip-faster/languages","stargazers_url":"https://api.github.com/repos/bukzor/pip-faster/stargazers","contributors_url":"https://api.github.com/repos/bukzor/pip-faster/contributors","subscribers_url":"https://api.github.com/repos/bukzor/pip-faster/subscribers","subscription_url":"https://api.github.com/repos/bukzor/pip-faster/subscription","commits_url":"https://api.github.com/repos/bukzor/pip-faster/commits{/sha}","git_commits_url":"https://api.github.com/repos/bukzor/pip-faster/git/commits{/sha}","comments_url":"https://api.github.com/repos/bukzor/pip-faster/comments{/number}","issue_comment_url":"https://api.github.com/repos/bukzor/pip-faster/issues/comments{/number}","contents_url":"https://api.github.com/repos/bukzor/pip-faster/contents/{+path}","compare_url":"https://api.github.com/repos/bukzor/pip-faster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bukzor/pip-faster/merges","archive_url":"https://api.github.com/repos/bukzor/pip-faster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bukzor/pip-faster/downloads","issues_url":"https://api.github.com/repos/bukzor/pip-faster/issues{/number}","pulls_url":"https://api.github.com/repos/bukzor/pip-faster/pulls{/number}","milestones_url":"https://api.github.com/repos/bukzor/pip-faster/milestones{/number}","notifications_url":"https://api.github.com/repos/bukzor/pip-faster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bukzor/pip-faster/labels{/name}","releases_url":"https://api.github.com/repos/bukzor/pip-faster/releases{/id}","deployments_url":"https://api.github.com/repos/bukzor/pip-faster/deployments","created_at":"2014-12-12T21:25:16Z","updated_at":"2015-11-20T23:51:21Z","pushed_at":"2016-02-03T19:19:17Z","git_url":"git://github.com/bukzor/pip-faster.git","ssh_url":"git@github.com:bukzor/pip-faster.git","clone_url":"https://github.com/bukzor/pip-faster.git","svn_url":"https://github.com/bukzor/pip-faster","homepage":null,"size":489,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"Yelp:master","ref":"master","sha":"833b223b3dec492b5cb950bfa30f5abba9221141","user":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"repo":{"id":24482164,"name":"pip-faster","full_name":"Yelp/pip-faster","owner":{"login":"Yelp","id":49071,"avatar_url":"https://avatars.githubusercontent.com/u/49071?v=3","gravatar_id":"","url":"https://api.github.com/users/Yelp","html_url":"https://github.com/Yelp","followers_url":"https://api.github.com/users/Yelp/followers","following_url":"https://api.github.com/users/Yelp/following{/other_user}","gists_url":"https://api.github.com/users/Yelp/gists{/gist_id}","starred_url":"https://api.github.com/users/Yelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yelp/subscriptions","organizations_url":"https://api.github.com/users/Yelp/orgs","repos_url":"https://api.github.com/users/Yelp/repos","events_url":"https://api.github.com/users/Yelp/events{/privacy}","received_events_url":"https://api.github.com/users/Yelp/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Yelp/pip-faster","description":"","fork":false,"url":"https://api.github.com/repos/Yelp/pip-faster","forks_url":"https://api.github.com/repos/Yelp/pip-faster/forks","keys_url":"https://api.github.com/repos/Yelp/pip-faster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Yelp/pip-faster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Yelp/pip-faster/teams","hooks_url":"https://api.github.com/repos/Yelp/pip-faster/hooks","issue_events_url":"https://api.github.com/repos/Yelp/pip-faster/issues/events{/number}","events_url":"https://api.github.com/repos/Yelp/pip-faster/events","assignees_url":"https://api.github.com/repos/Yelp/pip-faster/assignees{/user}","branches_url":"https://api.github.com/repos/Yelp/pip-faster/branches{/branch}","tags_url":"https://api.github.com/repos/Yelp/pip-faster/tags","blobs_url":"https://api.github.com/repos/Yelp/pip-faster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Yelp/pip-faster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Yelp/pip-faster/git/refs{/sha}","trees_url":"https://api.github.com/repos/Yelp/pip-faster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Yelp/pip-faster/statuses/{sha}","languages_url":"https://api.github.com/repos/Yelp/pip-faster/languages","stargazers_url":"https://api.github.com/repos/Yelp/pip-faster/stargazers","contributors_url":"https://api.github.com/repos/Yelp/pip-faster/contributors","subscribers_url":"https://api.github.com/repos/Yelp/pip-faster/subscribers","subscription_url":"https://api.github.com/repos/Yelp/pip-faster/subscription","commits_url":"https://api.github.com/repos/Yelp/pip-faster/commits{/sha}","git_commits_url":"https://api.github.com/repos/Yelp/pip-faster/git/commits{/sha}","comments_url":"https://api.github.com/repos/Yelp/pip-faster/comments{/number}","issue_comment_url":"https://api.github.com/repos/Yelp/pip-faster/issues/comments{/number}","contents_url":"https://api.github.com/repos/Yelp/pip-faster/contents/{+path}","compare_url":"https://api.github.com/repos/Yelp/pip-faster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Yelp/pip-faster/merges","archive_url":"https://api.github.com/repos/Yelp/pip-faster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Yelp/pip-faster/downloads","issues_url":"https://api.github.com/repos/Yelp/pip-faster/issues{/number}","pulls_url":"https://api.github.com/repos/Yelp/pip-faster/pulls{/number}","milestones_url":"https://api.github.com/repos/Yelp/pip-faster/milestones{/number}","notifications_url":"https://api.github.com/repos/Yelp/pip-faster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Yelp/pip-faster/labels{/name}","releases_url":"https://api.github.com/repos/Yelp/pip-faster/releases{/id}","deployments_url":"https://api.github.com/repos/Yelp/pip-faster/deployments","created_at":"2014-09-26T01:54:35Z","updated_at":"2016-01-14T16:25:27Z","pushed_at":"2016-02-03T19:21:34Z","git_url":"git://github.com/Yelp/pip-faster.git","ssh_url":"git@github.com:Yelp/pip-faster.git","clone_url":"https://github.com/Yelp/pip-faster.git","svn_url":"https://github.com/Yelp/pip-faster","homepage":null,"size":457,"stargazers_count":32,"watchers_count":32,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":13,"forks":10,"open_issues":13,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Yelp/pip-faster/pulls/110"},"html":{"href":"https://github.com/Yelp/pip-faster/pull/110"},"issue":{"href":"https://api.github.com/repos/Yelp/pip-faster/issues/110"},"comments":{"href":"https://api.github.com/repos/Yelp/pip-faster/issues/110/comments"},"review_comments":{"href":"https://api.github.com/repos/Yelp/pip-faster/pulls/110/comments"},"review_comment":{"href":"https://api.github.com/repos/Yelp/pip-faster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Yelp/pip-faster/pulls/110/commits"},"statuses":{"href":"https://api.github.com/repos/Yelp/pip-faster/statuses/72c2c633ede7db6ede612ab4071debfdb0c7004c"}}}}