{"action":"opened","issue":{"url":"https://api.github.com/repos/atom/atom/issues/7450","labels_url":"https://api.github.com/repos/atom/atom/issues/7450/labels{/name}","comments_url":"https://api.github.com/repos/atom/atom/issues/7450/comments","events_url":"https://api.github.com/repos/atom/atom/issues/7450/events","html_url":"https://github.com/atom/atom/issues/7450","id":91227372,"number":7450,"title":"The .python-version file causes build failure when using pyenv","user":{"login":"konradstrack","id":363290,"avatar_url":"https://avatars.githubusercontent.com/u/363290?v=3","gravatar_id":"","url":"https://api.github.com/users/konradstrack","html_url":"https://github.com/konradstrack","followers_url":"https://api.github.com/users/konradstrack/followers","following_url":"https://api.github.com/users/konradstrack/following{/other_user}","gists_url":"https://api.github.com/users/konradstrack/gists{/gist_id}","starred_url":"https://api.github.com/users/konradstrack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/konradstrack/subscriptions","organizations_url":"https://api.github.com/users/konradstrack/orgs","repos_url":"https://api.github.com/users/konradstrack/repos","events_url":"https://api.github.com/users/konradstrack/events{/privacy}","received_events_url":"https://api.github.com/users/konradstrack/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-26T11:20:46Z","updated_at":"2015-06-26T11:20:46Z","closed_at":null,"body":"The `.python-version` file was added with pull request #4454. \r\n\r\nWhen building Atom (any version) on Arch Linux (using AUR package: https://aur.archlinux.org/packages/atom-editor/) with pyenv installed (https://github.com/yyuu/pyenv), this is what happens:\r\n```\r\nNode: v0.12.5\r\nnpm: v2.11.3\r\nInstalling build modules...\r\ngyp ERR! configure error \r\ngyp ERR! stack Error: Command failed: python2 -c import platform; print(platform.python_version());\r\ngyp ERR! stack pyenv: version `2.7.6' is not installed\r\ngyp ERR! stack \r\ngyp ERR! stack     at ChildProcess.exithandler (child_process.js:751:12)\r\ngyp ERR! stack     at ChildProcess.emit (events.js:110:17)\r\ngyp ERR! stack     at maybeClose (child_process.js:1015:16)\r\ngyp ERR! stack     at Socket.<anonymous> (child_process.js:1183:11)\r\ngyp ERR! stack     at Socket.emit (events.js:107:17)\r\ngyp ERR! stack     at Pipe.close (net.js:485:12)\r\ngyp ERR! System Linux 4.0.5-1-ARCH\r\ngyp ERR! command \"node\" \"/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js\" \"rebuild\"\r\n(...)\r\n```\r\n\r\nAfter digging deeper with PYENV_DEBUG=1, we can see that pyenv tries to use Python 2.7.6 as specified in `.python-version` present in Atom's source:\r\n```\r\ngyp ERR! stack + [pyenv:108] exec /home/ancestor/.pyenv/libexec/pyenv-exec python2 -c 'import platform; print(platform.python_version());'\r\ngyp ERR! stack + [pyenv-exec:20] '[' python2 = --complete ']'\r\ngyp ERR! stack ++ [pyenv-exec:24] pyenv-version-name\r\ngyp ERR! stack + [pyenv-version-name:6] '[' -z '' ']'\r\ngyp ERR! stack ++ [pyenv-version-name:7] pyenv-version-file\r\ngyp ERR! stack + [pyenv-version-file:21] find_local_version_file /tmp/pacaurtmp-ancestor/atom-editor/src/atom-1.0.0/build/node_modules/runas\r\n(...)\r\ngyp ERR! stack + [pyenv-version-file:10] echo /tmp/pacaurtmp-ancestor/atom-editor/src/atom-1.0.0/.python-version\r\ngyp ERR! stack + [pyenv-version-file:11] exit\r\ngyp ERR! stack + [pyenv-version-name:7] PYENV_VERSION_FILE=/tmp/pacaurtmp-ancestor/atom-editor/src/atom-1.0.0/.python-version\r\ngyp ERR! stack ++ [pyenv-version-name:8] pyenv-version-file-read /tmp/pacaurtmp-ancestor/atom-editor/src/atom-1.0.0/.python-version\r\ngyp ERR! stack + [pyenv-version-file-read:6] VERSION_FILE=/tmp/pacaurtmp-ancestor/atom-editor/src/atom-1.0.0/.python-version\r\ngyp ERR! stack + [pyenv-version-file-read:8] '[' -e /tmp/pacaurtmp-ancestor/atom-editor/src/atom-1.0.0/.python-version ']'\r\ngyp ERR! stack + [pyenv-version-file-read:11] IFS=' \t\r\n'yp ERR! stack \r\ngyp ERR! stack + [pyenv-version-file-read:12] words=($(cut -b 1-1024 \"$VERSION_FILE\" | sed 's/^\\s*\\(\\S\\+\\).*/\\1/'))\r\ngyp ERR! stack ++ [pyenv-version-file-read:12] cut -b 1-1024 /tmp/pacaurtmp-ancestor/atom-editor/src/atom-1.0.0/.python-version\r\ngyp ERR! stack ++ [pyenv-version-file-read:12] sed 's/^\\s*\\(\\S\\+\\).*/\\1/'\r\ngyp ERR! stack + [pyenv-version-file-read:13] versions=(\"${words[@]}\")\r\ngyp ERR! stack + [pyenv-version-file-read:15] '[' -n 2.7.6 ']'\r\ngyp ERR! stack + [pyenv-version-file-read:16] IFS=:\r\ngyp ERR! stack + [pyenv-version-file-read:17] echo 2.7.6\r\ngyp ERR! stack + [pyenv-version-file-read:18] exit\r\ngyp ERR! stack + [pyenv-version-name:8] PYENV_VERSION=2.7.6\r\ngyp ERR! stack + [pyenv-version-name:11] '[' -z 2.7.6 ']'\r\ngyp ERR! stack + [pyenv-version-name:11] '[' 2.7.6 = system ']'\r\ngyp ERR! stack + [pyenv-version-name:21] versions=()\r\n```\r\n\r\nIt is Is there any reason for this file to actually be in the repository? Unless there is anything in Atom that requires Python version to be exactly 2.7.6 and pyenv for building it, the only effect this file would have is enforcing an old Python version on pyenv users.\r\n\r\nThere is a workaround, by overriding Python version with `pyenv shell`, but maybe the file could just be removed to avoid using this workaround for each build?"}}