{"action":"created","issue":{"url":"https://api.github.com/repos/pyugrid/pyugrid/issues/71","labels_url":"https://api.github.com/repos/pyugrid/pyugrid/issues/71/labels{/name}","comments_url":"https://api.github.com/repos/pyugrid/pyugrid/issues/71/comments","events_url":"https://api.github.com/repos/pyugrid/pyugrid/issues/71/events","html_url":"https://github.com/pyugrid/pyugrid/pull/71","id":94498869,"number":71,"title":"Extract version from __init__.py","user":{"login":"ocefpaf","id":950575,"avatar_url":"https://avatars.githubusercontent.com/u/950575?v=3","gravatar_id":"","url":"https://api.github.com/users/ocefpaf","html_url":"https://github.com/ocefpaf","followers_url":"https://api.github.com/users/ocefpaf/followers","following_url":"https://api.github.com/users/ocefpaf/following{/other_user}","gists_url":"https://api.github.com/users/ocefpaf/gists{/gist_id}","starred_url":"https://api.github.com/users/ocefpaf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ocefpaf/subscriptions","organizations_url":"https://api.github.com/users/ocefpaf/orgs","repos_url":"https://api.github.com/users/ocefpaf/repos","events_url":"https://api.github.com/users/ocefpaf/events{/privacy}","received_events_url":"https://api.github.com/users/ocefpaf/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-07-11T18:55:22Z","updated_at":"2015-07-13T15:12:51Z","closed_at":"2015-07-11T22:11:59Z","pull_request":{"url":"https://api.github.com/repos/pyugrid/pyugrid/pulls/71","html_url":"https://github.com/pyugrid/pyugrid/pull/71","diff_url":"https://github.com/pyugrid/pyugrid/pull/71.diff","patch_url":"https://github.com/pyugrid/pyugrid/pull/71.patch"},"body":"That way we maintain the version number in only one file and we do not need to import `pyugrid` to get the version.\r\n\r\nNote that I also pep8'd `setup.py `."},"comment":{"url":"https://api.github.com/repos/pyugrid/pyugrid/issues/comments/120962775","html_url":"https://github.com/pyugrid/pyugrid/pull/71#issuecomment-120962775","issue_url":"https://api.github.com/repos/pyugrid/pyugrid/issues/71","id":120962775,"user":{"login":"ChrisBarker-NOAA","id":916576,"avatar_url":"https://avatars.githubusercontent.com/u/916576?v=3","gravatar_id":"","url":"https://api.github.com/users/ChrisBarker-NOAA","html_url":"https://github.com/ChrisBarker-NOAA","followers_url":"https://api.github.com/users/ChrisBarker-NOAA/followers","following_url":"https://api.github.com/users/ChrisBarker-NOAA/following{/other_user}","gists_url":"https://api.github.com/users/ChrisBarker-NOAA/gists{/gist_id}","starred_url":"https://api.github.com/users/ChrisBarker-NOAA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChrisBarker-NOAA/subscriptions","organizations_url":"https://api.github.com/users/ChrisBarker-NOAA/orgs","repos_url":"https://api.github.com/users/ChrisBarker-NOAA/repos","events_url":"https://api.github.com/users/ChrisBarker-NOAA/events{/privacy}","received_events_url":"https://api.github.com/users/ChrisBarker-NOAA/received_events","type":"User","site_admin":false},"created_at":"2015-07-13T15:12:51Z","updated_at":"2015-07-13T15:12:51Z","body":"I'm rather confused by this \"automatic patching of __init__.py every time i\ndo anything with setup\" behavior, it's not a pattern I've ever seen before.\n\nWell, we all agree it's a hack ;-)\n\nWhy VERSION.txt on its own and not in __init__.py?\n\nThis is a pattern seeing wider use -- we want tools to be able to parse out\nthe version without importing anything, or parading out python. Or knowing\nthat the package __init__.py is where to look for version info.\n\nAnd tools asside, for users to have an obvious place to look.\n\nMeanwhile, it needs to be in the package run time, and available with\n\"setup.py --version\"\n\nAnd, of course, there needs to be one place to specify the version.\n\nSo this is the hack we came up with to accommodate all that.\n\nLess kludgy suggestions greatly appreciated!\n\nNote that git uses hashes, rather than modification times to determine a\nchange, so this shouldn't trigger constant meaningless changes to\n__init__.py in the git history.\n\nWouldn't this give issues to someone who installed to system python\n(admittedly rare to operate with the setup.py in there)?\n\n\nHow so? You never run setup.py on installed files. It's not even installed\nat all, is it?\n\nAnd when setup.py is run, the user needs permissions to write to the source\ndir anyway. Though not necessarily to the source itself....would that come\nup?\n\n-CHB\n"}}