{"action":"created","comment":{"url":"https://api.github.com/repos/pypa/pip/pulls/comments/27030301","id":27030301,"diff_hunk":"@@ -123,6 +133,68 @@ def prep_for_dist(self):\n         self.req_to_install.assert_source_matches_version()\n \n \n+class SetupCfgDistribution(pkg_resources.Distribution):\n+\n+    def __init__(self, cfg, location=None):\n+        self._cfg = cfg\n+        project_name = cfg.get('metadata', 'name')\n+        super(SetupCfgDistribution, self).__init__(\n+            location=location, project_name=project_name)\n+\n+    @property\n+    def _dep_map(self):\n+        try:\n+            return self.__dep_map\n+        except AttributeError:\n+            # requires\n+            try:\n+                requires = self._cfg.get('metadata', 'requires-dist')\n+            except configparser.NoOptionError:\n+                requires = []\n+            extras = (\n+                self._cfg.has_section('extras')\n+                and self._cfg.items('extras')) or []\n+            dm = {}\n+            dm.setdefault(None, []).extend(\n+                pkg_resources.parse_requirements(requires))\n+            for extra, extra_reqs in extras:\n+                dm.setdefault(extra, []).extend(\n+                    pkg_resources.parse_requirements(extra_reqs))\n+            return dm\n+\n+    def setup_requires(self):\n+        try:\n+            setup_requires = self._cfg.get('metadata', 'requires-setup')\n+        except configparser.NoOptionError:\n+            return []\n+        return pkg_resources.parse_requirements(setup_requires)\n+\n+\n+class IsStaticMetadata(DistAbstraction):\n+    \"\"\"A static setup.cfg based source tree.\n+\n+    Must have a name and requires|setup_requires in setup.cfg to be usable.","path":"pip/req/req_set.py","position":82,"original_position":82,"commit_id":"170d972faf225fd6bb094d51e1ab5db086b1e132","original_commit_id":"170d972faf225fd6bb094d51e1ab5db086b1e132","user":{"login":"emonty","id":95156,"avatar_url":"https://avatars.githubusercontent.com/u/95156?v=3","gravatar_id":"","url":"https://api.github.com/users/emonty","html_url":"https://github.com/emonty","followers_url":"https://api.github.com/users/emonty/followers","following_url":"https://api.github.com/users/emonty/following{/other_user}","gists_url":"https://api.github.com/users/emonty/gists{/gist_id}","starred_url":"https://api.github.com/users/emonty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emonty/subscriptions","organizations_url":"https://api.github.com/users/emonty/orgs","repos_url":"https://api.github.com/users/emonty/repos","events_url":"https://api.github.com/users/emonty/events{/privacy}","received_events_url":"https://api.github.com/users/emonty/received_events","type":"User","site_admin":false},"body":"s/setup_requires/requires-setup/","created_at":"2015-03-24T14:10:15Z","updated_at":"2015-03-24T14:10:15Z","html_url":"https://github.com/pypa/pip/pull/2603#discussion_r27030301","pull_request_url":"https://api.github.com/repos/pypa/pip/pulls/2603","_links":{"self":{"href":"https://api.github.com/repos/pypa/pip/pulls/comments/27030301"},"html":{"href":"https://github.com/pypa/pip/pull/2603#discussion_r27030301"},"pull_request":{"href":"https://api.github.com/repos/pypa/pip/pulls/2603"}}},"pull_request":{"url":"https://api.github.com/repos/pypa/pip/pulls/2603","id":31805573,"html_url":"https://github.com/pypa/pip/pull/2603","diff_url":"https://github.com/pypa/pip/pull/2603.diff","patch_url":"https://github.com/pypa/pip/pull/2603.patch","issue_url":"https://api.github.com/repos/pypa/pip/issues/2603","number":2603,"state":"open","locked":false,"title":"Declarative setuptools dependencies.","user":{"login":"rbtcollins","id":499678,"avatar_url":"https://avatars.githubusercontent.com/u/499678?v=3","gravatar_id":"","url":"https://api.github.com/users/rbtcollins","html_url":"https://github.com/rbtcollins","followers_url":"https://api.github.com/users/rbtcollins/followers","following_url":"https://api.github.com/users/rbtcollins/following{/other_user}","gists_url":"https://api.github.com/users/rbtcollins/gists{/gist_id}","starred_url":"https://api.github.com/users/rbtcollins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbtcollins/subscriptions","organizations_url":"https://api.github.com/users/rbtcollins/orgs","repos_url":"https://api.github.com/users/rbtcollins/repos","events_url":"https://api.github.com/users/rbtcollins/events{/privacy}","received_events_url":"https://api.github.com/users/rbtcollins/received_events","type":"User","site_admin":false},"body":"This adds support per the discussion we had on distutils-sig for\r\ndeclarative requirements in setup.cfg.\r\n    \r\nSupported are requires-setup (the problem to be solved). requires-dist\r\n(defined by d2to1, and needed as a consequences of supporting setup\r\nrequirements, because we can't run egg_info during the\r\npre-installation phase to detect requires. Similarly extras are\r\nsupported, for the same reason.\r\n    \r\nNeither setup-requires nor extras are defined by d2to1, so we may want\r\nto bikeshed a little over the syntax there, but the basic structure works.\r\n","created_at":"2015-03-24T08:33:25Z","updated_at":"2015-03-24T14:10:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd7c8c2010325a778147533a483b76b4bc40f314","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pypa/pip/pulls/2603/commits","review_comments_url":"https://api.github.com/repos/pypa/pip/pulls/2603/comments","review_comment_url":"https://api.github.com/repos/pypa/pip/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypa/pip/issues/2603/comments","statuses_url":"https://api.github.com/repos/pypa/pip/statuses/170d972faf225fd6bb094d51e1ab5db086b1e132","head":{"label":"rbtcollins:develop","ref":"develop","sha":"170d972faf225fd6bb094d51e1ab5db086b1e132","user":{"login":"rbtcollins","id":499678,"avatar_url":"https://avatars.githubusercontent.com/u/499678?v=3","gravatar_id":"","url":"https://api.github.com/users/rbtcollins","html_url":"https://github.com/rbtcollins","followers_url":"https://api.github.com/users/rbtcollins/followers","following_url":"https://api.github.com/users/rbtcollins/following{/other_user}","gists_url":"https://api.github.com/users/rbtcollins/gists{/gist_id}","starred_url":"https://api.github.com/users/rbtcollins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbtcollins/subscriptions","organizations_url":"https://api.github.com/users/rbtcollins/orgs","repos_url":"https://api.github.com/users/rbtcollins/repos","events_url":"https://api.github.com/users/rbtcollins/events{/privacy}","received_events_url":"https://api.github.com/users/rbtcollins/received_events","type":"User","site_admin":false},"repo":{"id":24315581,"name":"pip","full_name":"rbtcollins/pip","owner":{"login":"rbtcollins","id":499678,"avatar_url":"https://avatars.githubusercontent.com/u/499678?v=3","gravatar_id":"","url":"https://api.github.com/users/rbtcollins","html_url":"https://github.com/rbtcollins","followers_url":"https://api.github.com/users/rbtcollins/followers","following_url":"https://api.github.com/users/rbtcollins/following{/other_user}","gists_url":"https://api.github.com/users/rbtcollins/gists{/gist_id}","starred_url":"https://api.github.com/users/rbtcollins/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbtcollins/subscriptions","organizations_url":"https://api.github.com/users/rbtcollins/orgs","repos_url":"https://api.github.com/users/rbtcollins/repos","events_url":"https://api.github.com/users/rbtcollins/events{/privacy}","received_events_url":"https://api.github.com/users/rbtcollins/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rbtcollins/pip","description":"The PyPA recommended tool for installing Python packages","fork":true,"url":"https://api.github.com/repos/rbtcollins/pip","forks_url":"https://api.github.com/repos/rbtcollins/pip/forks","keys_url":"https://api.github.com/repos/rbtcollins/pip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rbtcollins/pip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rbtcollins/pip/teams","hooks_url":"https://api.github.com/repos/rbtcollins/pip/hooks","issue_events_url":"https://api.github.com/repos/rbtcollins/pip/issues/events{/number}","events_url":"https://api.github.com/repos/rbtcollins/pip/events","assignees_url":"https://api.github.com/repos/rbtcollins/pip/assignees{/user}","branches_url":"https://api.github.com/repos/rbtcollins/pip/branches{/branch}","tags_url":"https://api.github.com/repos/rbtcollins/pip/tags","blobs_url":"https://api.github.com/repos/rbtcollins/pip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rbtcollins/pip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rbtcollins/pip/git/refs{/sha}","trees_url":"https://api.github.com/repos/rbtcollins/pip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rbtcollins/pip/statuses/{sha}","languages_url":"https://api.github.com/repos/rbtcollins/pip/languages","stargazers_url":"https://api.github.com/repos/rbtcollins/pip/stargazers","contributors_url":"https://api.github.com/repos/rbtcollins/pip/contributors","subscribers_url":"https://api.github.com/repos/rbtcollins/pip/subscribers","subscription_url":"https://api.github.com/repos/rbtcollins/pip/subscription","commits_url":"https://api.github.com/repos/rbtcollins/pip/commits{/sha}","git_commits_url":"https://api.github.com/repos/rbtcollins/pip/git/commits{/sha}","comments_url":"https://api.github.com/repos/rbtcollins/pip/comments{/number}","issue_comment_url":"https://api.github.com/repos/rbtcollins/pip/issues/comments{/number}","contents_url":"https://api.github.com/repos/rbtcollins/pip/contents/{+path}","compare_url":"https://api.github.com/repos/rbtcollins/pip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rbtcollins/pip/merges","archive_url":"https://api.github.com/repos/rbtcollins/pip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rbtcollins/pip/downloads","issues_url":"https://api.github.com/repos/rbtcollins/pip/issues{/number}","pulls_url":"https://api.github.com/repos/rbtcollins/pip/pulls{/number}","milestones_url":"https://api.github.com/repos/rbtcollins/pip/milestones{/number}","notifications_url":"https://api.github.com/repos/rbtcollins/pip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rbtcollins/pip/labels{/name}","releases_url":"https://api.github.com/repos/rbtcollins/pip/releases{/id}","created_at":"2014-09-22T05:35:37Z","updated_at":"2015-03-24T08:36:22Z","pushed_at":"2015-03-24T08:36:22Z","git_url":"git://github.com/rbtcollins/pip.git","ssh_url":"git@github.com:rbtcollins/pip.git","clone_url":"https://github.com/rbtcollins/pip.git","svn_url":"https://github.com/rbtcollins/pip","homepage":"https://pip.pypa.io/","size":29683,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"develop"}},"base":{"label":"pypa:develop","ref":"develop","sha":"47963aec7fe854429db583494ef002e9036e1933","user":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"repo":{"id":1446467,"name":"pip","full_name":"pypa/pip","owner":{"login":"pypa","id":647025,"avatar_url":"https://avatars.githubusercontent.com/u/647025?v=3","gravatar_id":"","url":"https://api.github.com/users/pypa","html_url":"https://github.com/pypa","followers_url":"https://api.github.com/users/pypa/followers","following_url":"https://api.github.com/users/pypa/following{/other_user}","gists_url":"https://api.github.com/users/pypa/gists{/gist_id}","starred_url":"https://api.github.com/users/pypa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pypa/subscriptions","organizations_url":"https://api.github.com/users/pypa/orgs","repos_url":"https://api.github.com/users/pypa/repos","events_url":"https://api.github.com/users/pypa/events{/privacy}","received_events_url":"https://api.github.com/users/pypa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pypa/pip","description":"The PyPA recommended tool for installing Python packages","fork":false,"url":"https://api.github.com/repos/pypa/pip","forks_url":"https://api.github.com/repos/pypa/pip/forks","keys_url":"https://api.github.com/repos/pypa/pip/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/pip/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/pip/teams","hooks_url":"https://api.github.com/repos/pypa/pip/hooks","issue_events_url":"https://api.github.com/repos/pypa/pip/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/pip/events","assignees_url":"https://api.github.com/repos/pypa/pip/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/pip/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/pip/tags","blobs_url":"https://api.github.com/repos/pypa/pip/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/pip/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/pip/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/pip/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/pip/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/pip/languages","stargazers_url":"https://api.github.com/repos/pypa/pip/stargazers","contributors_url":"https://api.github.com/repos/pypa/pip/contributors","subscribers_url":"https://api.github.com/repos/pypa/pip/subscribers","subscription_url":"https://api.github.com/repos/pypa/pip/subscription","commits_url":"https://api.github.com/repos/pypa/pip/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/pip/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/pip/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/pip/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/pip/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/pip/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/pip/merges","archive_url":"https://api.github.com/repos/pypa/pip/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/pip/downloads","issues_url":"https://api.github.com/repos/pypa/pip/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/pip/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/pip/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/pip/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/pip/labels{/name}","releases_url":"https://api.github.com/repos/pypa/pip/releases{/id}","created_at":"2011-03-06T14:30:46Z","updated_at":"2015-03-24T02:46:26Z","pushed_at":"2015-03-24T10:32:23Z","git_url":"git://github.com/pypa/pip.git","ssh_url":"git@github.com:pypa/pip.git","clone_url":"https://github.com/pypa/pip.git","svn_url":"https://github.com/pypa/pip","homepage":"https://pip.pypa.io/","size":45189,"stargazers_count":1979,"watchers_count":1979,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":788,"mirror_url":null,"open_issues_count":533,"forks":788,"open_issues":533,"watchers":1979,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/pypa/pip/pulls/2603"},"html":{"href":"https://github.com/pypa/pip/pull/2603"},"issue":{"href":"https://api.github.com/repos/pypa/pip/issues/2603"},"comments":{"href":"https://api.github.com/repos/pypa/pip/issues/2603/comments"},"review_comments":{"href":"https://api.github.com/repos/pypa/pip/pulls/2603/comments"},"review_comment":{"href":"https://api.github.com/repos/pypa/pip/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypa/pip/pulls/2603/commits"},"statuses":{"href":"https://api.github.com/repos/pypa/pip/statuses/170d972faf225fd6bb094d51e1ab5db086b1e132"}}}}