{"action":"created","comment":{"url":"https://api.github.com/repos/pypa/bandersnatch/pulls/comments/190446853","pull_request_review_id":122823057,"id":190446853,"diff_hunk":"@@ -72,26 +71,55 @@ def check_match(self, **kwargs):\n         bool:\n             True if it matches, False otherwise.\n         \"\"\"\n-        logger.debug('Running filter plugin %s', self.name)\n         name = kwargs.get('name', None)\n         if not name:\n             return False\n \n-        logger.info(\n-            'Checking for package %s in %r', name, self.blacklist_package_names\n-        )\n         if name in self.blacklist_package_names:\n-            logger.debug(\n-                'MATCH: Package %r is in %r', name,\n-                self.blacklist_package_names\n-            )\n+            logger.debug(f'MATCH: Package {name!r} is in the blacklist')\n             return True\n         return False\n \n \n class BlacklistRelease(FilterReleasePlugin):\n     name = 'blacklist_release'\n \n+    def initialize_plugin(self):\n+        \"\"\"\n+        Initialize the plugin\n+        \"\"\"\n+        # Generate a list of blacklisted packages from the configuration and\n+        # store it into self.blacklist_package_names attribute so this\n+        # operation doesn't end up in the fastpath.\n+        self.blacklist_release_requirements = \\\n+            self._determine_filtered_package_requirements()\n+        logger.debug(\n+            f'Initialized release plugin {self.name!r}, filtering '\n+            f'{self.blacklist_release_requirements!r}'\n+        )\n+\n+    def _determine_filtered_package_requirements(self):\n+        \"\"\"\n+        Parse the configuration file for [blacklist]packages\n+\n+        Returns\n+        -------\n+        list of packaging.requirements.Requirement\n+            For all PEP440 package specifiers\n+        \"\"\"\n+        filtered_requirements = set()\n+        try:\n+            lines = self.configuration['blacklist']['packages']\n+            package_lines = lines.split('\\n')\n+        except KeyError:\n+            package_lines = []\n+        for package_line in package_lines:\n+            package_line = package_line.strip()\n+            if not package_line or package_line.startswith('#'):\n+                continue\n+            filtered_requirements.add(Requirement(package_line))","path":"src/bandersnatch_filter_plugins/blacklist_name.py","position":101,"original_position":101,"commit_id":"998afd5763619ada8fe90e187a1d893ca4981abb","original_commit_id":"998afd5763619ada8fe90e187a1d893ca4981abb","user":{"login":"cooperlees","id":3005596,"avatar_url":"https://avatars1.githubusercontent.com/u/3005596?v=4","gravatar_id":"","url":"https://api.github.com/users/cooperlees","html_url":"https://github.com/cooperlees","followers_url":"https://api.github.com/users/cooperlees/followers","following_url":"https://api.github.com/users/cooperlees/following{/other_user}","gists_url":"https://api.github.com/users/cooperlees/gists{/gist_id}","starred_url":"https://api.github.com/users/cooperlees/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cooperlees/subscriptions","organizations_url":"https://api.github.com/users/cooperlees/orgs","repos_url":"https://api.github.com/users/cooperlees/repos","events_url":"https://api.github.com/users/cooperlees/events{/privacy}","received_events_url":"https://api.github.com/users/cooperlees/received_events","type":"User","site_admin":false},"body":"This parsing code looks like code above - utility function?","created_at":"2018-05-24T01:56:59Z","updated_at":"2018-05-24T01:58:14Z","html_url":"https://github.com/pypa/bandersnatch/pull/29#discussion_r190446853","pull_request_url":"https://api.github.com/repos/pypa/bandersnatch/pulls/29","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/pypa/bandersnatch/pulls/comments/190446853"},"html":{"href":"https://github.com/pypa/bandersnatch/pull/29#discussion_r190446853"},"pull_request":{"href":"https://api.github.com/repos/pypa/bandersnatch/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/pypa/bandersnatch/pulls/29","id":190083667,"html_url":"https://github.com/pypa/bandersnatch/pull/29","diff_url":"https://github.com/pypa/bandersnatch/pull/29.diff","patch_url":"https://github.com/pypa/bandersnatch/pull/29.patch","issue_url":"https://api.github.com/repos/pypa/bandersnatch/issues/29","number":29,"state":"open","locked":false,"title":"Filter plugin fixes","user":{"login":"dwighthubbard","id":254983,"avatar_url":"https://avatars1.githubusercontent.com/u/254983?v=4","gravatar_id":"","url":"https://api.github.com/users/dwighthubbard","html_url":"https://github.com/dwighthubbard","followers_url":"https://api.github.com/users/dwighthubbard/followers","following_url":"https://api.github.com/users/dwighthubbard/following{/other_user}","gists_url":"https://api.github.com/users/dwighthubbard/gists{/gist_id}","starred_url":"https://api.github.com/users/dwighthubbard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwighthubbard/subscriptions","organizations_url":"https://api.github.com/users/dwighthubbard/orgs","repos_url":"https://api.github.com/users/dwighthubbard/repos","events_url":"https://api.github.com/users/dwighthubbard/events{/privacy}","received_events_url":"https://api.github.com/users/dwighthubbard/received_events","type":"User","site_admin":false},"body":"This is to address issue #28 \r\n\r\nThe problem is the configuration object being used by the plugins does not load the configuration file passed as a command line argument in main() as a result the plugins are ignoring setting values from the actual configuration file.\r\n\r\nThis fixes the issue by populating the configuration singleton with the configuration file name.\r\n\r\nThis also includes some code that evidently didn't get included in the release plugin that was needed to actually validate the release versions.","created_at":"2018-05-23T19:40:43Z","updated_at":"2018-05-24T01:58:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"056922a8f475b73479c998b96424d26040aa0287","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/pypa/bandersnatch/pulls/29/commits","review_comments_url":"https://api.github.com/repos/pypa/bandersnatch/pulls/29/comments","review_comment_url":"https://api.github.com/repos/pypa/bandersnatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pypa/bandersnatch/issues/29/comments","statuses_url":"https://api.github.com/repos/pypa/bandersnatch/statuses/998afd5763619ada8fe90e187a1d893ca4981abb","head":{"label":"pypa:filter_plugin_fixes","ref":"filter_plugin_fixes","sha":"998afd5763619ada8fe90e187a1d893ca4981abb","user":{"login":"pypa","id":647025,"avatar_url":"https://avatars2.githubusercontent.com/u/647025?v=4","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":133377409,"name":"bandersnatch","full_name":"pypa/bandersnatch","owner":{"login":"pypa","id":647025,"avatar_url":"https://avatars2.githubusercontent.com/u/647025?v=4","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/bandersnatch","description":"This is a PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/","fork":false,"url":"https://api.github.com/repos/pypa/bandersnatch","forks_url":"https://api.github.com/repos/pypa/bandersnatch/forks","keys_url":"https://api.github.com/repos/pypa/bandersnatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/bandersnatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/bandersnatch/teams","hooks_url":"https://api.github.com/repos/pypa/bandersnatch/hooks","issue_events_url":"https://api.github.com/repos/pypa/bandersnatch/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/bandersnatch/events","assignees_url":"https://api.github.com/repos/pypa/bandersnatch/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/bandersnatch/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/bandersnatch/tags","blobs_url":"https://api.github.com/repos/pypa/bandersnatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/bandersnatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/bandersnatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/bandersnatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/bandersnatch/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/bandersnatch/languages","stargazers_url":"https://api.github.com/repos/pypa/bandersnatch/stargazers","contributors_url":"https://api.github.com/repos/pypa/bandersnatch/contributors","subscribers_url":"https://api.github.com/repos/pypa/bandersnatch/subscribers","subscription_url":"https://api.github.com/repos/pypa/bandersnatch/subscription","commits_url":"https://api.github.com/repos/pypa/bandersnatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/bandersnatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/bandersnatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/bandersnatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/bandersnatch/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/bandersnatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/bandersnatch/merges","archive_url":"https://api.github.com/repos/pypa/bandersnatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/bandersnatch/downloads","issues_url":"https://api.github.com/repos/pypa/bandersnatch/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/bandersnatch/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/bandersnatch/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/bandersnatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/bandersnatch/labels{/name}","releases_url":"https://api.github.com/repos/pypa/bandersnatch/releases{/id}","deployments_url":"https://api.github.com/repos/pypa/bandersnatch/deployments","created_at":"2018-05-14T14:52:22Z","updated_at":"2018-05-24T01:47:47Z","pushed_at":"2018-05-24T01:48:12Z","git_url":"git://github.com/pypa/bandersnatch.git","ssh_url":"git@github.com:pypa/bandersnatch.git","clone_url":"https://github.com/pypa/bandersnatch.git","svn_url":"https://github.com/pypa/bandersnatch","homepage":"","size":429,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"afl-3.0","name":"Academic Free License v3.0","spdx_id":"AFL-3.0","url":"https://api.github.com/licenses/afl-3.0"},"forks":0,"open_issues":15,"watchers":6,"default_branch":"master"}},"base":{"label":"pypa:master","ref":"master","sha":"4757064f933ebfd47f5ad73fee96a42918fd4fd0","user":{"login":"pypa","id":647025,"avatar_url":"https://avatars2.githubusercontent.com/u/647025?v=4","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":133377409,"name":"bandersnatch","full_name":"pypa/bandersnatch","owner":{"login":"pypa","id":647025,"avatar_url":"https://avatars2.githubusercontent.com/u/647025?v=4","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/bandersnatch","description":"This is a PyPI mirror client according to PEP 381 http://www.python.org/dev/peps/pep-0381/","fork":false,"url":"https://api.github.com/repos/pypa/bandersnatch","forks_url":"https://api.github.com/repos/pypa/bandersnatch/forks","keys_url":"https://api.github.com/repos/pypa/bandersnatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pypa/bandersnatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pypa/bandersnatch/teams","hooks_url":"https://api.github.com/repos/pypa/bandersnatch/hooks","issue_events_url":"https://api.github.com/repos/pypa/bandersnatch/issues/events{/number}","events_url":"https://api.github.com/repos/pypa/bandersnatch/events","assignees_url":"https://api.github.com/repos/pypa/bandersnatch/assignees{/user}","branches_url":"https://api.github.com/repos/pypa/bandersnatch/branches{/branch}","tags_url":"https://api.github.com/repos/pypa/bandersnatch/tags","blobs_url":"https://api.github.com/repos/pypa/bandersnatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pypa/bandersnatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pypa/bandersnatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/pypa/bandersnatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pypa/bandersnatch/statuses/{sha}","languages_url":"https://api.github.com/repos/pypa/bandersnatch/languages","stargazers_url":"https://api.github.com/repos/pypa/bandersnatch/stargazers","contributors_url":"https://api.github.com/repos/pypa/bandersnatch/contributors","subscribers_url":"https://api.github.com/repos/pypa/bandersnatch/subscribers","subscription_url":"https://api.github.com/repos/pypa/bandersnatch/subscription","commits_url":"https://api.github.com/repos/pypa/bandersnatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/pypa/bandersnatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/pypa/bandersnatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/pypa/bandersnatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/pypa/bandersnatch/contents/{+path}","compare_url":"https://api.github.com/repos/pypa/bandersnatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pypa/bandersnatch/merges","archive_url":"https://api.github.com/repos/pypa/bandersnatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pypa/bandersnatch/downloads","issues_url":"https://api.github.com/repos/pypa/bandersnatch/issues{/number}","pulls_url":"https://api.github.com/repos/pypa/bandersnatch/pulls{/number}","milestones_url":"https://api.github.com/repos/pypa/bandersnatch/milestones{/number}","notifications_url":"https://api.github.com/repos/pypa/bandersnatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pypa/bandersnatch/labels{/name}","releases_url":"https://api.github.com/repos/pypa/bandersnatch/releases{/id}","deployments_url":"https://api.github.com/repos/pypa/bandersnatch/deployments","created_at":"2018-05-14T14:52:22Z","updated_at":"2018-05-24T01:47:47Z","pushed_at":"2018-05-24T01:48:12Z","git_url":"git://github.com/pypa/bandersnatch.git","ssh_url":"git@github.com:pypa/bandersnatch.git","clone_url":"https://github.com/pypa/bandersnatch.git","svn_url":"https://github.com/pypa/bandersnatch","homepage":"","size":429,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"afl-3.0","name":"Academic Free License v3.0","spdx_id":"AFL-3.0","url":"https://api.github.com/licenses/afl-3.0"},"forks":0,"open_issues":15,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pypa/bandersnatch/pulls/29"},"html":{"href":"https://github.com/pypa/bandersnatch/pull/29"},"issue":{"href":"https://api.github.com/repos/pypa/bandersnatch/issues/29"},"comments":{"href":"https://api.github.com/repos/pypa/bandersnatch/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/pypa/bandersnatch/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/pypa/bandersnatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pypa/bandersnatch/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/pypa/bandersnatch/statuses/998afd5763619ada8fe90e187a1d893ca4981abb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"cooperlees"}}