{"action":"created","comment":{"url":"https://api.github.com/repos/spacetelescope/asv/pulls/comments/29515785","id":29515785,"diff_hunk":"@@ -53,38 +45,64 @@ def get_version():\n                                     stdout=subprocess.PIPE, stderr=subprocess.PIPE)\n             rev, err = proc.communicate()\n             if proc.returncode == 0:\n-                revision = rev.strip()[:8].decode('ascii')\n+                revision = rev.strip().decode('ascii')\n         except OSError:\n             pass\n+    return revision\n+\n \n+def write_version_file(filename, version, revision):\n     # Write revision file (only if it needs to be changed)\n-    content = 'revision = \"{0}\"\\n'.format(revision)\n+    content = '''\n+__version__ = \"{0}\"\n+__githash__ = \"{1}\"\n+__release__ = {2}\n+    '''.format(version, revision, 'dev' in version)\n+\n     old_content = None\n-    fn = os.path.join(basedir, 'asv', '_version.py')\n-    if os.path.isfile(fn):\n-        with open(fn, 'r') as f:\n+    if os.path.isfile(filename):\n+        with open(filename, 'r') as f:\n             old_content = f.read()\n     if content != old_content:\n-        with open(fn, 'w') as f:\n+        with open(filename, 'w') as f:\n             f.write(content)\n \n-    # The revision is not added to the version given to setup(), since\n-    # that disturbs 'setup.py develop'\n-    return version\n+\n+version = '0.1dev'","path":"setup.py","position":72,"original_position":72,"commit_id":"833e0f7f9cda04cb8271c75adb401180f30f3028","original_commit_id":"833e0f7f9cda04cb8271c75adb401180f30f3028","user":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"body":"It gets appended with the first few characters of the githash below.  However, reading PEP 440 again, it seems this is supposed to be a positive integer, and by that, I suspect an ordinal one, too.  I've updated this to use `rev-list --count`.","created_at":"2015-05-01T17:10:17Z","updated_at":"2015-05-01T17:10:17Z","html_url":"https://github.com/spacetelescope/asv/pull/267#discussion_r29515785","pull_request_url":"https://api.github.com/repos/spacetelescope/asv/pulls/267","_links":{"self":{"href":"https://api.github.com/repos/spacetelescope/asv/pulls/comments/29515785"},"html":{"href":"https://github.com/spacetelescope/asv/pull/267#discussion_r29515785"},"pull_request":{"href":"https://api.github.com/repos/spacetelescope/asv/pulls/267"}}},"pull_request":{"url":"https://api.github.com/repos/spacetelescope/asv/pulls/267","id":34547989,"html_url":"https://github.com/spacetelescope/asv/pull/267","diff_url":"https://github.com/spacetelescope/asv/pull/267.diff","patch_url":"https://github.com/spacetelescope/asv/pull/267.patch","issue_url":"https://api.github.com/repos/spacetelescope/asv/issues/267","number":267,"state":"open","locked":false,"title":"Prepare for making releases","user":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"body":"Adds a few things, like a changelog, manifest, zest.releaser plugins etc. to prepare us to start making releases.","created_at":"2015-05-01T16:27:31Z","updated_at":"2015-05-01T17:10:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5375da93f17b7016c1f53b61281a235f35e08127","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/spacetelescope/asv/pulls/267/commits","review_comments_url":"https://api.github.com/repos/spacetelescope/asv/pulls/267/comments","review_comment_url":"https://api.github.com/repos/spacetelescope/asv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/spacetelescope/asv/issues/267/comments","statuses_url":"https://api.github.com/repos/spacetelescope/asv/statuses/833e0f7f9cda04cb8271c75adb401180f30f3028","head":{"label":"mdboom:prepare-for-release","ref":"prepare-for-release","sha":"833e0f7f9cda04cb8271c75adb401180f30f3028","user":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"repo":{"id":15798755,"name":"asv","full_name":"mdboom/asv","owner":{"login":"mdboom","id":38294,"avatar_url":"https://avatars.githubusercontent.com/u/38294?v=3","gravatar_id":"","url":"https://api.github.com/users/mdboom","html_url":"https://github.com/mdboom","followers_url":"https://api.github.com/users/mdboom/followers","following_url":"https://api.github.com/users/mdboom/following{/other_user}","gists_url":"https://api.github.com/users/mdboom/gists{/gist_id}","starred_url":"https://api.github.com/users/mdboom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mdboom/subscriptions","organizations_url":"https://api.github.com/users/mdboom/orgs","repos_url":"https://api.github.com/users/mdboom/repos","events_url":"https://api.github.com/users/mdboom/events{/privacy}","received_events_url":"https://api.github.com/users/mdboom/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mdboom/asv","description":"Airspeed Velocity: A simple Python benchmarking tool with web-based reporting","fork":true,"url":"https://api.github.com/repos/mdboom/asv","forks_url":"https://api.github.com/repos/mdboom/asv/forks","keys_url":"https://api.github.com/repos/mdboom/asv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mdboom/asv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mdboom/asv/teams","hooks_url":"https://api.github.com/repos/mdboom/asv/hooks","issue_events_url":"https://api.github.com/repos/mdboom/asv/issues/events{/number}","events_url":"https://api.github.com/repos/mdboom/asv/events","assignees_url":"https://api.github.com/repos/mdboom/asv/assignees{/user}","branches_url":"https://api.github.com/repos/mdboom/asv/branches{/branch}","tags_url":"https://api.github.com/repos/mdboom/asv/tags","blobs_url":"https://api.github.com/repos/mdboom/asv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mdboom/asv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mdboom/asv/git/refs{/sha}","trees_url":"https://api.github.com/repos/mdboom/asv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mdboom/asv/statuses/{sha}","languages_url":"https://api.github.com/repos/mdboom/asv/languages","stargazers_url":"https://api.github.com/repos/mdboom/asv/stargazers","contributors_url":"https://api.github.com/repos/mdboom/asv/contributors","subscribers_url":"https://api.github.com/repos/mdboom/asv/subscribers","subscription_url":"https://api.github.com/repos/mdboom/asv/subscription","commits_url":"https://api.github.com/repos/mdboom/asv/commits{/sha}","git_commits_url":"https://api.github.com/repos/mdboom/asv/git/commits{/sha}","comments_url":"https://api.github.com/repos/mdboom/asv/comments{/number}","issue_comment_url":"https://api.github.com/repos/mdboom/asv/issues/comments{/number}","contents_url":"https://api.github.com/repos/mdboom/asv/contents/{+path}","compare_url":"https://api.github.com/repos/mdboom/asv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mdboom/asv/merges","archive_url":"https://api.github.com/repos/mdboom/asv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mdboom/asv/downloads","issues_url":"https://api.github.com/repos/mdboom/asv/issues{/number}","pulls_url":"https://api.github.com/repos/mdboom/asv/pulls{/number}","milestones_url":"https://api.github.com/repos/mdboom/asv/milestones{/number}","notifications_url":"https://api.github.com/repos/mdboom/asv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mdboom/asv/labels{/name}","releases_url":"https://api.github.com/repos/mdboom/asv/releases{/id}","created_at":"2014-01-10T13:30:09Z","updated_at":"2015-03-06T19:04:23Z","pushed_at":"2015-05-01T16:27:00Z","git_url":"git://github.com/mdboom/asv.git","ssh_url":"git@github.com:mdboom/asv.git","clone_url":"https://github.com/mdboom/asv.git","svn_url":"https://github.com/mdboom/asv","homepage":"http://spacetelescope.github.io/asv","size":2727,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"spacetelescope:master","ref":"master","sha":"611855193cb082a10f9dd04f136e2f22ed70b567","user":{"login":"spacetelescope","id":2751928,"avatar_url":"https://avatars.githubusercontent.com/u/2751928?v=3","gravatar_id":"","url":"https://api.github.com/users/spacetelescope","html_url":"https://github.com/spacetelescope","followers_url":"https://api.github.com/users/spacetelescope/followers","following_url":"https://api.github.com/users/spacetelescope/following{/other_user}","gists_url":"https://api.github.com/users/spacetelescope/gists{/gist_id}","starred_url":"https://api.github.com/users/spacetelescope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacetelescope/subscriptions","organizations_url":"https://api.github.com/users/spacetelescope/orgs","repos_url":"https://api.github.com/users/spacetelescope/repos","events_url":"https://api.github.com/users/spacetelescope/events{/privacy}","received_events_url":"https://api.github.com/users/spacetelescope/received_events","type":"Organization","site_admin":false},"repo":{"id":14215348,"name":"asv","full_name":"spacetelescope/asv","owner":{"login":"spacetelescope","id":2751928,"avatar_url":"https://avatars.githubusercontent.com/u/2751928?v=3","gravatar_id":"","url":"https://api.github.com/users/spacetelescope","html_url":"https://github.com/spacetelescope","followers_url":"https://api.github.com/users/spacetelescope/followers","following_url":"https://api.github.com/users/spacetelescope/following{/other_user}","gists_url":"https://api.github.com/users/spacetelescope/gists{/gist_id}","starred_url":"https://api.github.com/users/spacetelescope/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spacetelescope/subscriptions","organizations_url":"https://api.github.com/users/spacetelescope/orgs","repos_url":"https://api.github.com/users/spacetelescope/repos","events_url":"https://api.github.com/users/spacetelescope/events{/privacy}","received_events_url":"https://api.github.com/users/spacetelescope/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/spacetelescope/asv","description":"Airspeed Velocity: A simple Python benchmarking tool with web-based reporting","fork":false,"url":"https://api.github.com/repos/spacetelescope/asv","forks_url":"https://api.github.com/repos/spacetelescope/asv/forks","keys_url":"https://api.github.com/repos/spacetelescope/asv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/spacetelescope/asv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/spacetelescope/asv/teams","hooks_url":"https://api.github.com/repos/spacetelescope/asv/hooks","issue_events_url":"https://api.github.com/repos/spacetelescope/asv/issues/events{/number}","events_url":"https://api.github.com/repos/spacetelescope/asv/events","assignees_url":"https://api.github.com/repos/spacetelescope/asv/assignees{/user}","branches_url":"https://api.github.com/repos/spacetelescope/asv/branches{/branch}","tags_url":"https://api.github.com/repos/spacetelescope/asv/tags","blobs_url":"https://api.github.com/repos/spacetelescope/asv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/spacetelescope/asv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/spacetelescope/asv/git/refs{/sha}","trees_url":"https://api.github.com/repos/spacetelescope/asv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/spacetelescope/asv/statuses/{sha}","languages_url":"https://api.github.com/repos/spacetelescope/asv/languages","stargazers_url":"https://api.github.com/repos/spacetelescope/asv/stargazers","contributors_url":"https://api.github.com/repos/spacetelescope/asv/contributors","subscribers_url":"https://api.github.com/repos/spacetelescope/asv/subscribers","subscription_url":"https://api.github.com/repos/spacetelescope/asv/subscription","commits_url":"https://api.github.com/repos/spacetelescope/asv/commits{/sha}","git_commits_url":"https://api.github.com/repos/spacetelescope/asv/git/commits{/sha}","comments_url":"https://api.github.com/repos/spacetelescope/asv/comments{/number}","issue_comment_url":"https://api.github.com/repos/spacetelescope/asv/issues/comments{/number}","contents_url":"https://api.github.com/repos/spacetelescope/asv/contents/{+path}","compare_url":"https://api.github.com/repos/spacetelescope/asv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/spacetelescope/asv/merges","archive_url":"https://api.github.com/repos/spacetelescope/asv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/spacetelescope/asv/downloads","issues_url":"https://api.github.com/repos/spacetelescope/asv/issues{/number}","pulls_url":"https://api.github.com/repos/spacetelescope/asv/pulls{/number}","milestones_url":"https://api.github.com/repos/spacetelescope/asv/milestones{/number}","notifications_url":"https://api.github.com/repos/spacetelescope/asv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/spacetelescope/asv/labels{/name}","releases_url":"https://api.github.com/repos/spacetelescope/asv/releases{/id}","created_at":"2013-11-07T20:43:31Z","updated_at":"2015-05-01T16:45:08Z","pushed_at":"2015-05-01T16:54:53Z","git_url":"git://github.com/spacetelescope/asv.git","ssh_url":"git@github.com:spacetelescope/asv.git","clone_url":"https://github.com/spacetelescope/asv.git","svn_url":"https://github.com/spacetelescope/asv","homepage":"http://asv.readthedocs.org/","size":4066,"stargazers_count":62,"watchers_count":62,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":34,"forks":23,"open_issues":34,"watchers":62,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/spacetelescope/asv/pulls/267"},"html":{"href":"https://github.com/spacetelescope/asv/pull/267"},"issue":{"href":"https://api.github.com/repos/spacetelescope/asv/issues/267"},"comments":{"href":"https://api.github.com/repos/spacetelescope/asv/issues/267/comments"},"review_comments":{"href":"https://api.github.com/repos/spacetelescope/asv/pulls/267/comments"},"review_comment":{"href":"https://api.github.com/repos/spacetelescope/asv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/spacetelescope/asv/pulls/267/commits"},"statuses":{"href":"https://api.github.com/repos/spacetelescope/asv/statuses/833e0f7f9cda04cb8271c75adb401180f30f3028"}}}}