{"action":"created","comment":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/237163294","pull_request_review_id":179394916,"id":237163294,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzE2MzI5NA==","diff_hunk":"@@ -1,92 +1,107 @@\n #!/usr/bin/env python\n-#\n-# Print the names of any third-party packages needed for the current\n-# Chapel environment settings\n-#\n-# ASSUMPTIONS:\n-# - This script is located in .../chapel/util/chplenv/third-party-pkgs\n-# - The format of the output from 'printchplenv' follows the current\n-#   conventions.  Specifically,\n-#   - Chapel-specific environment variables are prefixed with 'CHPL_' (***)\n-#   - Any Chapel environment variable ending in '_PLATFORM' describes\n-#     the hardware/OS combo and will not considered in this script\n-#   - \"Top-level\" Chapel environment variables are printed starting\n-#     in the first column.  Any Chapel environment variables that \n-#     indented are assumed to be modifiers of the corresponding top-level\n-#     variable and will not be considered in this script (*** and also\n-#     do not necessarily have to be prefixed with 'CHPL_')\n-# - $CHPL_HOME/third-party/<pkg>/Makefile.include defines any aliases\n-#   for the package name in a variable called XXX_ALIASES where XXX\n-#   is the directory name in all caps.\n-#\n-# - if the file COMPILERONLY exists in the third party directory,\n-#   that package is emitted if --compiler is passed,\n-#   and not by default (which gives dependencies for runtime).\n-#\n-from __future__ import print_function, absolute_import\n-\n-import os, os.path, sys, subprocess\n-\n-utildir = os.path.split(sys.argv[0])\n-chpl_home = utildir[0]+'/../..'\n-\n-third_party = chpl_home+'/third-party'\n-third_party_pkgs = os.listdir(third_party)\n-\n-#\n-# Add any aliases\n-#\n-pkg_aliases = dict()\n-for dir in third_party_pkgs:\n-    if dir == '.svn':\n-        continue\n-    deffile = third_party+'/'+dir+'/Makefile.include'\n-    aliasvar = dir.upper()+'_ALIASES'\n-    if os.access(deffile, os.F_OK) and os.access(deffile, os.R_OK):\n-        f = open(deffile, 'r')\n-        for line in f.readlines():\n-            varvalue = line.strip().split('=')\n-            if varvalue[0] == aliasvar:\n-                aliases = varvalue[1].split()\n-                for a in aliases:\n-                    pkg_aliases[a] = dir\n-                break\n-        f.close()\n-\n-printchplenv = chpl_home+'/util/printchplenv'\n-chplenv=subprocess.Popen([printchplenv, '--simple', '--internal', '--runtime', '--anonymize', '--no-tidy'],\n-                         stdout=subprocess.PIPE).communicate()[0].decode()\n-\n-pkgs=set()\n-for l in chplenv.split('\\n'):\n-    # Consider only lines to that start with 'CHPL_'.\n-    if l.startswith('CHPL_'):\n-        (var, val) = l.split('=', 1)\n-        var=var.strip()\n-        val=val.strip()\n-        # Ignore platform variables\n-        # Ignore CHPL_MEM (use CHPL_JEMALLOC)\n-        if not (var.endswith('_PLATFORM') or var == 'CHPL_MEM'):\n-            if third_party_pkgs.count(val)==1:\n-                pkgs.add(val)\n-            elif val in pkg_aliases:\n-                pkgs.add(pkg_aliases[val])\n-\n-# Filter dependencies into 2 list: compiler and runtime dependencies.\n-comppkgs=set()\n-runpkgs=set()\n-for p in pkgs:\n-  if os.path.isfile(third_party + \"/\" + p + \"/COMPILERONLY\"):\n-    comppkgs.add(p)\n-  else:\n-    runpkgs.add(p)\n-\n-if len(sys.argv) > 1 and sys.argv[1] == \"--compiler\":\n-  pkgs = comppkgs\n-else:\n-  pkgs = runpkgs\n-\n-pkgs_text = ' '.join(pkgs)\n-\n-print(pkgs_text)\n \n+\"\"\"\n+ Print the names of any third-party packages needed for the current\n+ Chapel environment settings\n+\n+ ASSUMPTIONS:\n+ - This script is located in .../chapel/util/chplenv/third-party-pkgs\n+ - The format of the output from 'printchplenv' follows the current\n+   conventions.  Specifically,\n+   - Chapel-specific environment variables are prefixed with 'CHPL_' (***)\n+   - Any Chapel environment variable ending in '_PLATFORM' describes\n+     the hardware/OS combo and will not considered in this script\n+   - \"Top-level\" Chapel environment variables are printed starting\n+     in the first column.  Any Chapel environment variables that \n+     indented are assumed to be modifiers of the corresponding top-level\n+     variable and will not be considered in this script (*** and also\n+     do not necessarily have to be prefixed with 'CHPL_')\n+ - $CHPL_HOME/third-party/<pkg>/Makefile.include defines any aliases\n+   for the package name in a variable called XXX_ALIASES where XXX\n+   is the directory name in all caps.\n+\n+ - if the file COMPILERONLY exists in the third party directory,\n+   that package is emitted if --compiler is passed,\n+   and not by default (which gives dependencies for runtime).\n+\"\"\"\n+\n+import optparse\n+import os\n+import sys\n+\n+chplenv_dir = os.path.dirname(__file__)\n+sys.path.insert(0, os.path.abspath(chplenv_dir))\n+\n+import utils\n+from chpl_home_utils import get_chpl_third_party, get_chpl_home\n+\n+def get_all_pkgs():","path":"util/chplenv/third-party-pkgs","position":128,"original_position":128,"commit_id":"22e4c8587cba6876a6bfc9ddb2105ac741e1e611","original_commit_id":"22e4c8587cba6876a6bfc9ddb2105ac741e1e611","user":{"login":"ben-albrecht","id":3595449,"node_id":"MDQ6VXNlcjM1OTU0NDk=","avatar_url":"https://avatars1.githubusercontent.com/u/3595449?v=4","gravatar_id":"","url":"https://api.github.com/users/ben-albrecht","html_url":"https://github.com/ben-albrecht","followers_url":"https://api.github.com/users/ben-albrecht/followers","following_url":"https://api.github.com/users/ben-albrecht/following{/other_user}","gists_url":"https://api.github.com/users/ben-albrecht/gists{/gist_id}","starred_url":"https://api.github.com/users/ben-albrecht/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ben-albrecht/subscriptions","organizations_url":"https://api.github.com/users/ben-albrecht/orgs","repos_url":"https://api.github.com/users/ben-albrecht/repos","events_url":"https://api.github.com/users/ben-albrecht/events{/privacy}","received_events_url":"https://api.github.com/users/ben-albrecht/received_events","type":"User","site_admin":false},"body":"I did not realize that. Sounds good.","created_at":"2018-11-28T16:34:26Z","updated_at":"2018-11-28T16:34:26Z","html_url":"https://github.com/chapel-lang/chapel/pull/11709#discussion_r237163294","pull_request_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments/237163294"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/11709#discussion_r237163294"},"pull_request":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709"}},"in_reply_to_id":237115439},"pull_request":{"url":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709","id":234090271,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0MDkwMjcx","html_url":"https://github.com/chapel-lang/chapel/pull/11709","diff_url":"https://github.com/chapel-lang/chapel/pull/11709.diff","patch_url":"https://github.com/chapel-lang/chapel/pull/11709.patch","issue_url":"https://api.github.com/repos/chapel-lang/chapel/issues/11709","number":11709,"state":"open","locked":false,"title":"Cleanup util/chplenv/third-party-pkgs","user":{"login":"ronawho","id":1588337,"node_id":"MDQ6VXNlcjE1ODgzMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/1588337?v=4","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"body":"Make it more pythonic and cleanup implementation:\r\n - don't hardcode '/', use os.path.join\r\n - don't use file open/close, use with stmt\r\n - don't manually look at sys.argv, use optparse\r\n - use list comprehension to cleanup compiler/runtime filtering\r\n - `list.count(val)` => `val in list`\r\n - don't recompute chpl_home/third-party, use chpl_home_utils\r\n - split code into functions\r\n - use run_command instead of subprocess+decode\r\n - better var names, and avoid using builtin names like \"dir\"","created_at":"2018-11-27T22:55:24Z","updated_at":"2018-11-28T16:34:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"222a39832e46f9d034e09305c0de8a77be9ed263","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709/commits","review_comments_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709/comments","review_comment_url":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/issues/11709/comments","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/22e4c8587cba6876a6bfc9ddb2105ac741e1e611","head":{"label":"ronawho:cleanup-third-party-pkgs","ref":"cleanup-third-party-pkgs","sha":"22e4c8587cba6876a6bfc9ddb2105ac741e1e611","user":{"login":"ronawho","id":1588337,"node_id":"MDQ6VXNlcjE1ODgzMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/1588337?v=4","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"repo":{"id":21908970,"node_id":"MDEwOlJlcG9zaXRvcnkyMTkwODk3MA==","name":"chapel","full_name":"ronawho/chapel","private":false,"owner":{"login":"ronawho","id":1588337,"node_id":"MDQ6VXNlcjE1ODgzMzc=","avatar_url":"https://avatars1.githubusercontent.com/u/1588337?v=4","gravatar_id":"","url":"https://api.github.com/users/ronawho","html_url":"https://github.com/ronawho","followers_url":"https://api.github.com/users/ronawho/followers","following_url":"https://api.github.com/users/ronawho/following{/other_user}","gists_url":"https://api.github.com/users/ronawho/gists{/gist_id}","starred_url":"https://api.github.com/users/ronawho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ronawho/subscriptions","organizations_url":"https://api.github.com/users/ronawho/orgs","repos_url":"https://api.github.com/users/ronawho/repos","events_url":"https://api.github.com/users/ronawho/events{/privacy}","received_events_url":"https://api.github.com/users/ronawho/received_events","type":"User","site_admin":false},"html_url":"https://github.com/ronawho/chapel","description":"a Productive Parallel Programming Language","fork":true,"url":"https://api.github.com/repos/ronawho/chapel","forks_url":"https://api.github.com/repos/ronawho/chapel/forks","keys_url":"https://api.github.com/repos/ronawho/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ronawho/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ronawho/chapel/teams","hooks_url":"https://api.github.com/repos/ronawho/chapel/hooks","issue_events_url":"https://api.github.com/repos/ronawho/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/ronawho/chapel/events","assignees_url":"https://api.github.com/repos/ronawho/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/ronawho/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/ronawho/chapel/tags","blobs_url":"https://api.github.com/repos/ronawho/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ronawho/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ronawho/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/ronawho/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ronawho/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/ronawho/chapel/languages","stargazers_url":"https://api.github.com/repos/ronawho/chapel/stargazers","contributors_url":"https://api.github.com/repos/ronawho/chapel/contributors","subscribers_url":"https://api.github.com/repos/ronawho/chapel/subscribers","subscription_url":"https://api.github.com/repos/ronawho/chapel/subscription","commits_url":"https://api.github.com/repos/ronawho/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/ronawho/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/ronawho/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/ronawho/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/ronawho/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/ronawho/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ronawho/chapel/merges","archive_url":"https://api.github.com/repos/ronawho/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ronawho/chapel/downloads","issues_url":"https://api.github.com/repos/ronawho/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/ronawho/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/ronawho/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/ronawho/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ronawho/chapel/labels{/name}","releases_url":"https://api.github.com/repos/ronawho/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/ronawho/chapel/deployments","created_at":"2014-07-16T16:46:31Z","updated_at":"2018-11-27T06:25:16Z","pushed_at":"2018-11-28T16:09:03Z","git_url":"git://github.com/ronawho/chapel.git","ssh_url":"git@github.com:ronawho/chapel.git","clone_url":"https://github.com/ronawho/chapel.git","svn_url":"https://github.com/ronawho/chapel","homepage":"http://chapel.cray.com/","size":559400,"stargazers_count":2,"watchers_count":2,"language":"Chapel","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"chapel-lang:master","ref":"master","sha":"0a5ac4ee368890b2f696268878127dfe3b6890fc","user":{"login":"chapel-lang","id":7597261,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1OTcyNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/7597261?v=4","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":21663285,"node_id":"MDEwOlJlcG9zaXRvcnkyMTY2MzI4NQ==","name":"chapel","full_name":"chapel-lang/chapel","private":false,"owner":{"login":"chapel-lang","id":7597261,"node_id":"MDEyOk9yZ2FuaXphdGlvbjc1OTcyNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/7597261?v=4","gravatar_id":"","url":"https://api.github.com/users/chapel-lang","html_url":"https://github.com/chapel-lang","followers_url":"https://api.github.com/users/chapel-lang/followers","following_url":"https://api.github.com/users/chapel-lang/following{/other_user}","gists_url":"https://api.github.com/users/chapel-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/chapel-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chapel-lang/subscriptions","organizations_url":"https://api.github.com/users/chapel-lang/orgs","repos_url":"https://api.github.com/users/chapel-lang/repos","events_url":"https://api.github.com/users/chapel-lang/events{/privacy}","received_events_url":"https://api.github.com/users/chapel-lang/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/chapel-lang/chapel","description":"a Productive Parallel Programming Language","fork":false,"url":"https://api.github.com/repos/chapel-lang/chapel","forks_url":"https://api.github.com/repos/chapel-lang/chapel/forks","keys_url":"https://api.github.com/repos/chapel-lang/chapel/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chapel-lang/chapel/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chapel-lang/chapel/teams","hooks_url":"https://api.github.com/repos/chapel-lang/chapel/hooks","issue_events_url":"https://api.github.com/repos/chapel-lang/chapel/issues/events{/number}","events_url":"https://api.github.com/repos/chapel-lang/chapel/events","assignees_url":"https://api.github.com/repos/chapel-lang/chapel/assignees{/user}","branches_url":"https://api.github.com/repos/chapel-lang/chapel/branches{/branch}","tags_url":"https://api.github.com/repos/chapel-lang/chapel/tags","blobs_url":"https://api.github.com/repos/chapel-lang/chapel/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chapel-lang/chapel/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chapel-lang/chapel/git/refs{/sha}","trees_url":"https://api.github.com/repos/chapel-lang/chapel/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chapel-lang/chapel/statuses/{sha}","languages_url":"https://api.github.com/repos/chapel-lang/chapel/languages","stargazers_url":"https://api.github.com/repos/chapel-lang/chapel/stargazers","contributors_url":"https://api.github.com/repos/chapel-lang/chapel/contributors","subscribers_url":"https://api.github.com/repos/chapel-lang/chapel/subscribers","subscription_url":"https://api.github.com/repos/chapel-lang/chapel/subscription","commits_url":"https://api.github.com/repos/chapel-lang/chapel/commits{/sha}","git_commits_url":"https://api.github.com/repos/chapel-lang/chapel/git/commits{/sha}","comments_url":"https://api.github.com/repos/chapel-lang/chapel/comments{/number}","issue_comment_url":"https://api.github.com/repos/chapel-lang/chapel/issues/comments{/number}","contents_url":"https://api.github.com/repos/chapel-lang/chapel/contents/{+path}","compare_url":"https://api.github.com/repos/chapel-lang/chapel/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chapel-lang/chapel/merges","archive_url":"https://api.github.com/repos/chapel-lang/chapel/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chapel-lang/chapel/downloads","issues_url":"https://api.github.com/repos/chapel-lang/chapel/issues{/number}","pulls_url":"https://api.github.com/repos/chapel-lang/chapel/pulls{/number}","milestones_url":"https://api.github.com/repos/chapel-lang/chapel/milestones{/number}","notifications_url":"https://api.github.com/repos/chapel-lang/chapel/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chapel-lang/chapel/labels{/name}","releases_url":"https://api.github.com/repos/chapel-lang/chapel/releases{/id}","deployments_url":"https://api.github.com/repos/chapel-lang/chapel/deployments","created_at":"2014-07-09T18:15:54Z","updated_at":"2018-11-28T03:33:03Z","pushed_at":"2018-11-28T16:09:10Z","git_url":"git://github.com/chapel-lang/chapel.git","ssh_url":"git@github.com:chapel-lang/chapel.git","clone_url":"https://github.com/chapel-lang/chapel.git","svn_url":"https://github.com/chapel-lang/chapel","homepage":"https://chapel-lang.org","size":554220,"stargazers_count":732,"watchers_count":732,"language":"Chapel","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":195,"mirror_url":null,"archived":false,"open_issues_count":1248,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":195,"open_issues":1248,"watchers":732,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709"},"html":{"href":"https://github.com/chapel-lang/chapel/pull/11709"},"issue":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/11709"},"comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/issues/11709/comments"},"review_comments":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709/comments"},"review_comment":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chapel-lang/chapel/pulls/11709/commits"},"statuses":{"href":"https://api.github.com/repos/chapel-lang/chapel/statuses/22e4c8587cba6876a6bfc9ddb2105ac741e1e611"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ben-albrecht"}}