{"action":"created","comment":{"url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/comments/167332621","pull_request_review_id":95545327,"id":167332621,"diff_hunk":"@@ -0,0 +1,124 @@\n+from base64 import b64encode\n+from base64 import b64decode\n+import codecs\n+import os\n+from collections import defaultdict\n+from collections import namedtuple\n+import github3\n+from pkg_resources import parse_version\n+import re\n+import requests\n+import subprocess\n+import yaml\n+from jinja2 import UndefinedError\n+from jinja2 import Template\n+\n+\n+def pypi_version(meta_yaml, package_name, gh):\n+    splitter = '-{}.'.format(meta_yaml['package']['version'])\n+\n+    r = requests.get('https://pypi.python.org/pypi/{}/json'.format(\n+        package_name))\n+    if not r.ok:\n+        print('Could not find version on pypi', package_name)\n+        return False\n+    return r.json()['info']['version'].strip()\n+\n+\n+def gh_version(meta_yaml, package_name, gh):\n+    splitter = '-{}.'.format(meta_yaml['package']['version'])\n+\n+    split_url = meta_yaml['source']['url'].lower().split('/')\n+    package_owner = split_url[split_url.index('github.com') + 1]\n+    # get all the tags\n+    repo = gh.repository(package_owner, package_name)\n+    if not repo:\n+        print(\"could not find repo\", package_name)\n+        return False\n+\n+    rels = [r.tag_name for r in repo.iter_releases()]\n+    if len(rels) == 0:\n+        print(\"no releases found\", package_name)\n+        return False\n+\n+    return max(rels)\n+\n+def parsed_meta_yaml(text):\n+    \"\"\"\n+    :param str text: The raw text in conda-forge feedstock meta.yaml file\n+    :return: `dict|None` -- parsed YAML dict if successful, None if not\n+    \"\"\"\n+    try:\n+        yaml_dict = yaml.load(Template(text).render())\n+    except UndefinedError:\n+        # assume we hit a RECIPE_DIR reference in the vars and can't parse it.\n+        # just erase for now\n+        try:\n+            yaml_dict = yaml.load(\n+                Template(\n+                    re.sub('{{ (environ\\[\")?RECIPE_DIR(\"])? }}/', '',\n+                           text)\n+                ).render())\n+        except:\n+            return None\n+    except:\n+        return None\n+\n+    return yaml_dict\n+\n+def source_location(meta_yaml):\n+    try:\n+        if 'github.com' in meta_yaml['source']['url']:","path":"tick-feedstocks/core3.xsh","position":71,"original_position":71,"commit_id":"622518e8770bcac272787191c59dfc1069a7f017","original_commit_id":"622518e8770bcac272787191c59dfc1069a7f017","user":{"login":"CJ-Wright","id":6740689,"avatar_url":"https://avatars3.githubusercontent.com/u/6740689?v=4","gravatar_id":"","url":"https://api.github.com/users/CJ-Wright","html_url":"https://github.com/CJ-Wright","followers_url":"https://api.github.com/users/CJ-Wright/followers","following_url":"https://api.github.com/users/CJ-Wright/following{/other_user}","gists_url":"https://api.github.com/users/CJ-Wright/gists{/gist_id}","starred_url":"https://api.github.com/users/CJ-Wright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CJ-Wright/subscriptions","organizations_url":"https://api.github.com/users/CJ-Wright/orgs","repos_url":"https://api.github.com/users/CJ-Wright/repos","events_url":"https://api.github.com/users/CJ-Wright/events{/privacy}","received_events_url":"https://api.github.com/users/CJ-Wright/received_events","type":"User","site_admin":false},"body":"you can use `{}.get('source', {}).get('url', None)` to not need the try except.","created_at":"2018-02-09T20:06:00Z","updated_at":"2018-02-09T20:09:21Z","html_url":"https://github.com/CJ-Wright/tick-my-feedstocks/pull/1#discussion_r167332621","pull_request_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/comments/167332621"},"html":{"href":"https://github.com/CJ-Wright/tick-my-feedstocks/pull/1#discussion_r167332621"},"pull_request":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1","id":168324829,"html_url":"https://github.com/CJ-Wright/tick-my-feedstocks/pull/1","diff_url":"https://github.com/CJ-Wright/tick-my-feedstocks/pull/1.diff","patch_url":"https://github.com/CJ-Wright/tick-my-feedstocks/pull/1.patch","issue_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/issues/1","number":1,"state":"open","locked":false,"title":"WIP: xonsh script","user":{"login":"justcalamari","id":12699826,"avatar_url":"https://avatars1.githubusercontent.com/u/12699826?v=4","gravatar_id":"","url":"https://api.github.com/users/justcalamari","html_url":"https://github.com/justcalamari","followers_url":"https://api.github.com/users/justcalamari/followers","following_url":"https://api.github.com/users/justcalamari/following{/other_user}","gists_url":"https://api.github.com/users/justcalamari/gists{/gist_id}","starred_url":"https://api.github.com/users/justcalamari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justcalamari/subscriptions","organizations_url":"https://api.github.com/users/justcalamari/orgs","repos_url":"https://api.github.com/users/justcalamari/repos","events_url":"https://api.github.com/users/justcalamari/events{/privacy}","received_events_url":"https://api.github.com/users/justcalamari/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-02-09T19:37:40Z","updated_at":"2018-02-09T20:09:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d49b4b10d4f6e9264c06e2799c1519e91b715760","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1/commits","review_comments_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1/comments","review_comment_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/issues/1/comments","statuses_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/statuses/622518e8770bcac272787191c59dfc1069a7f017","head":{"label":"justcalamari:xonsh","ref":"xonsh","sha":"622518e8770bcac272787191c59dfc1069a7f017","user":{"login":"justcalamari","id":12699826,"avatar_url":"https://avatars1.githubusercontent.com/u/12699826?v=4","gravatar_id":"","url":"https://api.github.com/users/justcalamari","html_url":"https://github.com/justcalamari","followers_url":"https://api.github.com/users/justcalamari/followers","following_url":"https://api.github.com/users/justcalamari/following{/other_user}","gists_url":"https://api.github.com/users/justcalamari/gists{/gist_id}","starred_url":"https://api.github.com/users/justcalamari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justcalamari/subscriptions","organizations_url":"https://api.github.com/users/justcalamari/orgs","repos_url":"https://api.github.com/users/justcalamari/repos","events_url":"https://api.github.com/users/justcalamari/events{/privacy}","received_events_url":"https://api.github.com/users/justcalamari/received_events","type":"User","site_admin":false},"repo":{"id":118652573,"name":"tick-my-feedstocks","full_name":"justcalamari/tick-my-feedstocks","owner":{"login":"justcalamari","id":12699826,"avatar_url":"https://avatars1.githubusercontent.com/u/12699826?v=4","gravatar_id":"","url":"https://api.github.com/users/justcalamari","html_url":"https://github.com/justcalamari","followers_url":"https://api.github.com/users/justcalamari/followers","following_url":"https://api.github.com/users/justcalamari/following{/other_user}","gists_url":"https://api.github.com/users/justcalamari/gists{/gist_id}","starred_url":"https://api.github.com/users/justcalamari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/justcalamari/subscriptions","organizations_url":"https://api.github.com/users/justcalamari/orgs","repos_url":"https://api.github.com/users/justcalamari/repos","events_url":"https://api.github.com/users/justcalamari/events{/privacy}","received_events_url":"https://api.github.com/users/justcalamari/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/justcalamari/tick-my-feedstocks","description":"Automatically update conda-forge feedstocks by ticking versions, updating hashes, and creating pull requests","fork":true,"url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks","forks_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/forks","keys_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/teams","hooks_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/hooks","issue_events_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/issues/events{/number}","events_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/events","assignees_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/assignees{/user}","branches_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/branches{/branch}","tags_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/tags","blobs_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/statuses/{sha}","languages_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/languages","stargazers_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/stargazers","contributors_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/contributors","subscribers_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/subscribers","subscription_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/subscription","commits_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/contents/{+path}","compare_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/merges","archive_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/downloads","issues_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/issues{/number}","pulls_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/pulls{/number}","milestones_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/milestones{/number}","notifications_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/labels{/name}","releases_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/releases{/id}","deployments_url":"https://api.github.com/repos/justcalamari/tick-my-feedstocks/deployments","created_at":"2018-01-23T18:37:58Z","updated_at":"2018-01-23T18:38:00Z","pushed_at":"2018-02-09T19:39:38Z","git_url":"git://github.com/justcalamari/tick-my-feedstocks.git","ssh_url":"git@github.com:justcalamari/tick-my-feedstocks.git","clone_url":"https://github.com/justcalamari/tick-my-feedstocks.git","svn_url":"https://github.com/justcalamari/tick-my-feedstocks","homepage":null,"size":62,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"CJ-Wright:xonsh","ref":"xonsh","sha":"65e228ff921bacb8f0839b4e45645c766abfad1f","user":{"login":"CJ-Wright","id":6740689,"avatar_url":"https://avatars3.githubusercontent.com/u/6740689?v=4","gravatar_id":"","url":"https://api.github.com/users/CJ-Wright","html_url":"https://github.com/CJ-Wright","followers_url":"https://api.github.com/users/CJ-Wright/followers","following_url":"https://api.github.com/users/CJ-Wright/following{/other_user}","gists_url":"https://api.github.com/users/CJ-Wright/gists{/gist_id}","starred_url":"https://api.github.com/users/CJ-Wright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CJ-Wright/subscriptions","organizations_url":"https://api.github.com/users/CJ-Wright/orgs","repos_url":"https://api.github.com/users/CJ-Wright/repos","events_url":"https://api.github.com/users/CJ-Wright/events{/privacy}","received_events_url":"https://api.github.com/users/CJ-Wright/received_events","type":"User","site_admin":false},"repo":{"id":114203251,"name":"tick-my-feedstocks","full_name":"CJ-Wright/tick-my-feedstocks","owner":{"login":"CJ-Wright","id":6740689,"avatar_url":"https://avatars3.githubusercontent.com/u/6740689?v=4","gravatar_id":"","url":"https://api.github.com/users/CJ-Wright","html_url":"https://github.com/CJ-Wright","followers_url":"https://api.github.com/users/CJ-Wright/followers","following_url":"https://api.github.com/users/CJ-Wright/following{/other_user}","gists_url":"https://api.github.com/users/CJ-Wright/gists{/gist_id}","starred_url":"https://api.github.com/users/CJ-Wright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CJ-Wright/subscriptions","organizations_url":"https://api.github.com/users/CJ-Wright/orgs","repos_url":"https://api.github.com/users/CJ-Wright/repos","events_url":"https://api.github.com/users/CJ-Wright/events{/privacy}","received_events_url":"https://api.github.com/users/CJ-Wright/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/CJ-Wright/tick-my-feedstocks","description":"Automatically update conda-forge feedstocks by ticking versions, updating hashes, and creating pull requests","fork":true,"url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks","forks_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/forks","keys_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/teams","hooks_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/hooks","issue_events_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/issues/events{/number}","events_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/events","assignees_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/assignees{/user}","branches_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/branches{/branch}","tags_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/tags","blobs_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/git/refs{/sha}","trees_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/statuses/{sha}","languages_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/languages","stargazers_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/stargazers","contributors_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/contributors","subscribers_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/subscribers","subscription_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/subscription","commits_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/commits{/sha}","git_commits_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/git/commits{/sha}","comments_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/comments{/number}","issue_comment_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/issues/comments{/number}","contents_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/contents/{+path}","compare_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/merges","archive_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/downloads","issues_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/issues{/number}","pulls_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls{/number}","milestones_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/milestones{/number}","notifications_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/labels{/name}","releases_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/releases{/id}","deployments_url":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/deployments","created_at":"2017-12-14T04:40:48Z","updated_at":"2017-12-14T04:40:50Z","pushed_at":"2018-02-09T19:39:39Z","git_url":"git://github.com/CJ-Wright/tick-my-feedstocks.git","ssh_url":"git@github.com:CJ-Wright/tick-my-feedstocks.git","clone_url":"https://github.com/CJ-Wright/tick-my-feedstocks.git","svn_url":"https://github.com/CJ-Wright/tick-my-feedstocks","homepage":null,"size":55,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1"},"html":{"href":"https://github.com/CJ-Wright/tick-my-feedstocks/pull/1"},"issue":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/issues/1"},"comments":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/CJ-Wright/tick-my-feedstocks/statuses/622518e8770bcac272787191c59dfc1069a7f017"}},"author_association":"NONE"}}
{"actor":{"display_login":"CJ-Wright"}}