{"action":"created","comment":{"url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/comments/157056155","pull_request_review_id":83638562,"id":157056155,"diff_hunk":"@@ -371,29 +423,48 @@ def pypi_org_sha(package_name, version):\n     return None, None\n \n \n-def pypi_sha(pypi_package, pypi_version):\n+def sha(package, version, package_type='pypi', package_url=None,\n+        prior_version=None):\n     \"\"\"\n-    :param str pypi_package: The name of the package in PyPI\n-    :param str pypi_version: The version to be retrieved from PyPI.\n+    :param str package: The name of the package in PyPI\n+    :param str version: The version to be retrieved from PyPI.\n     :return: `str|None` -- SHA256 for a source bundle, None if can't be found\n     \"\"\"\n-    bundle_type, sha = pypi_legacy_json_sha(pypi_package, pypi_version)\n-    if bundle_type is not None and sha is not None:\n-        return bundle_type, sha\n-    return pypi_org_sha(pypi_package, pypi_version)\n+    if package_type == 'github':\n+        package_url = package_url.replace(prior_version, version)\n+        return hash_url(package_url)\n+    else:\n+        bundle_type, sha = pypi_legacy_json_sha(package, version)\n+        if bundle_type is not None and sha is not None:\n+            return bundle_type, sha\n+        return pypi_org_sha(package, version)\n \n \n-def pypi_version_str(package_name):\n+def version_str(package_name, package_type='pypi', package_owner=None):\n     \"\"\"\n     Retrive the latest version of a package in PyPI\n     :param str package_name: The name of the package\n+    :param str package_type: The type of package ('pypi' or 'github')\n     :return: `str|bool` -- Version string, False if unsuccessful\n     \"\"\"\n-    r = requests.get('https://pypi.python.org/pypi/{}/json'.format(\n-        package_name))\n-    if not r.ok:\n-        return False\n-    return r.json()['info']['version'].strip()\n+    if package_type == 'pypi':\n+        r = requests.get('https://pypi.python.org/pypi/{}/json'.format(\n+            package_name))\n+        if not r.ok:\n+            return False\n+        return r.json()['info']['version'].strip()\n+    elif package_type == 'github':\n+        # get all the tags\n+        refs = requests.get('https://api.github.com/repos/{owner}/'\n+                         '{repo}/git/refs/tags'.format(owner=package_owner,\n+                                                       repo=package_name))","path":"scripts/tick_my_feedstocks.py","position":167,"original_position":167,"commit_id":"1a313c0fddb62c76b2c89e11085f6c9b53e8e3f4","original_commit_id":"1a313c0fddb62c76b2c89e11085f6c9b53e8e3f4","user":{"login":"isuruf","id":5234427,"avatar_url":"https://avatars3.githubusercontent.com/u/5234427?v=4","gravatar_id":"","url":"https://api.github.com/users/isuruf","html_url":"https://github.com/isuruf","followers_url":"https://api.github.com/users/isuruf/followers","following_url":"https://api.github.com/users/isuruf/following{/other_user}","gists_url":"https://api.github.com/users/isuruf/gists{/gist_id}","starred_url":"https://api.github.com/users/isuruf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/isuruf/subscriptions","organizations_url":"https://api.github.com/users/isuruf/orgs","repos_url":"https://api.github.com/users/isuruf/repos","events_url":"https://api.github.com/users/isuruf/events{/privacy}","received_events_url":"https://api.github.com/users/isuruf/received_events","type":"User","site_admin":false},"body":"There was some talk about this at https://github.com/conda-forge/feedstocks/issues/12","created_at":"2017-12-14T20:41:22Z","updated_at":"2017-12-14T20:41:22Z","html_url":"https://github.com/conda-forge/conda-forge.github.io/pull/502#discussion_r157056155","pull_request_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/comments/157056155"},"html":{"href":"https://github.com/conda-forge/conda-forge.github.io/pull/502#discussion_r157056155"},"pull_request":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502"}},"in_reply_to_id":157045355},"pull_request":{"url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502","id":158446873,"html_url":"https://github.com/conda-forge/conda-forge.github.io/pull/502","diff_url":"https://github.com/conda-forge/conda-forge.github.io/pull/502.diff","patch_url":"https://github.com/conda-forge/conda-forge.github.io/pull/502.patch","issue_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/issues/502","number":502,"state":"open","locked":false,"title":"WIP: add github ticking functionality","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":"This is my attempt to add github support to the `tick_my_feedstocks.py` script. (sorry about some of the reformatting, my IDE tried to fix some pep8 stuff and went overboard)\r\nSpecial credit to @scopatz for the url hasher.","created_at":"2017-12-14T19:47:32Z","updated_at":"2017-12-14T20:41:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9790a5593a48e275ffd174eed55219b40b020537","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502/commits","review_comments_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502/comments","review_comment_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/issues/502/comments","statuses_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/statuses/1a313c0fddb62c76b2c89e11085f6c9b53e8e3f4","head":{"label":"CJ-Wright:tick_github","ref":"tick_github","sha":"1a313c0fddb62c76b2c89e11085f6c9b53e8e3f4","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":99236529,"name":"conda-forge.github.io","full_name":"CJ-Wright/conda-forge.github.io","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/conda-forge.github.io","description":"Documentation for conda-forge","fork":true,"url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io","forks_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/forks","keys_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/teams","hooks_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/hooks","issue_events_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/events","assignees_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/tags","blobs_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/languages","stargazers_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/stargazers","contributors_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/contributors","subscribers_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/subscribers","subscription_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/subscription","commits_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/merges","archive_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/downloads","issues_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/labels{/name}","releases_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/CJ-Wright/conda-forge.github.io/deployments","created_at":"2017-08-03T13:39:42Z","updated_at":"2017-08-03T13:39:44Z","pushed_at":"2017-12-14T19:45:18Z","git_url":"git://github.com/CJ-Wright/conda-forge.github.io.git","ssh_url":"git@github.com:CJ-Wright/conda-forge.github.io.git","clone_url":"https://github.com/CJ-Wright/conda-forge.github.io.git","svn_url":"https://github.com/CJ-Wright/conda-forge.github.io","homepage":"https://conda-forge.github.io","size":2677,"stargazers_count":0,"watchers_count":0,"language":"HTML","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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"conda-forge:master","ref":"master","sha":"6bc413f9de7957194afdc239e1f89ba32b549da8","user":{"login":"conda-forge","id":11897326,"avatar_url":"https://avatars3.githubusercontent.com/u/11897326?v=4","gravatar_id":"","url":"https://api.github.com/users/conda-forge","html_url":"https://github.com/conda-forge","followers_url":"https://api.github.com/users/conda-forge/followers","following_url":"https://api.github.com/users/conda-forge/following{/other_user}","gists_url":"https://api.github.com/users/conda-forge/gists{/gist_id}","starred_url":"https://api.github.com/users/conda-forge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conda-forge/subscriptions","organizations_url":"https://api.github.com/users/conda-forge/orgs","repos_url":"https://api.github.com/users/conda-forge/repos","events_url":"https://api.github.com/users/conda-forge/events{/privacy}","received_events_url":"https://api.github.com/users/conda-forge/received_events","type":"Organization","site_admin":false},"repo":{"id":38962730,"name":"conda-forge.github.io","full_name":"conda-forge/conda-forge.github.io","owner":{"login":"conda-forge","id":11897326,"avatar_url":"https://avatars3.githubusercontent.com/u/11897326?v=4","gravatar_id":"","url":"https://api.github.com/users/conda-forge","html_url":"https://github.com/conda-forge","followers_url":"https://api.github.com/users/conda-forge/followers","following_url":"https://api.github.com/users/conda-forge/following{/other_user}","gists_url":"https://api.github.com/users/conda-forge/gists{/gist_id}","starred_url":"https://api.github.com/users/conda-forge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/conda-forge/subscriptions","organizations_url":"https://api.github.com/users/conda-forge/orgs","repos_url":"https://api.github.com/users/conda-forge/repos","events_url":"https://api.github.com/users/conda-forge/events{/privacy}","received_events_url":"https://api.github.com/users/conda-forge/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/conda-forge/conda-forge.github.io","description":"Documentation for conda-forge","fork":false,"url":"https://api.github.com/repos/conda-forge/conda-forge.github.io","forks_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/forks","keys_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/teams","hooks_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/hooks","issue_events_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/issues/events{/number}","events_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/events","assignees_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/assignees{/user}","branches_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/branches{/branch}","tags_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/tags","blobs_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/statuses/{sha}","languages_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/languages","stargazers_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/stargazers","contributors_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/contributors","subscribers_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/subscribers","subscription_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/subscription","commits_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/contents/{+path}","compare_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/merges","archive_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/downloads","issues_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/issues{/number}","pulls_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls{/number}","milestones_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/milestones{/number}","notifications_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/labels{/name}","releases_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/releases{/id}","deployments_url":"https://api.github.com/repos/conda-forge/conda-forge.github.io/deployments","created_at":"2015-07-12T13:22:31Z","updated_at":"2017-12-08T03:20:23Z","pushed_at":"2017-12-14T19:47:33Z","git_url":"git://github.com/conda-forge/conda-forge.github.io.git","ssh_url":"git@github.com:conda-forge/conda-forge.github.io.git","clone_url":"https://github.com/conda-forge/conda-forge.github.io.git","svn_url":"https://github.com/conda-forge/conda-forge.github.io","homepage":"https://conda-forge.org","size":3041,"stargazers_count":21,"watchers_count":21,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":47,"mirror_url":null,"archived":false,"open_issues_count":107,"license":{"key":"bsd-3-clause","name":"BSD 3-clause \"New\" or \"Revised\" License","spdx_id":"BSD-3-Clause","url":"https://api.github.com/licenses/bsd-3-clause"},"forks":47,"open_issues":107,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502"},"html":{"href":"https://github.com/conda-forge/conda-forge.github.io/pull/502"},"issue":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/issues/502"},"comments":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/issues/502/comments"},"review_comments":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502/comments"},"review_comment":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/pulls/502/commits"},"statuses":{"href":"https://api.github.com/repos/conda-forge/conda-forge.github.io/statuses/1a313c0fddb62c76b2c89e11085f6c9b53e8e3f4"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"isuruf"}}