{"action":"created","issue":{"url":"https://api.github.com/repos/kewlfft/ansible-aur/issues/4","repository_url":"https://api.github.com/repos/kewlfft/ansible-aur","labels_url":"https://api.github.com/repos/kewlfft/ansible-aur/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/kewlfft/ansible-aur/issues/4/comments","events_url":"https://api.github.com/repos/kewlfft/ansible-aur/issues/4/events","html_url":"https://github.com/kewlfft/ansible-aur/pull/4","id":325137759,"number":4,"title":"Drop dependency on ansible (six.moves)","user":{"login":"panchoh","id":471059,"avatar_url":"https://avatars0.githubusercontent.com/u/471059?v=4","gravatar_id":"","url":"https://api.github.com/users/panchoh","html_url":"https://github.com/panchoh","followers_url":"https://api.github.com/users/panchoh/followers","following_url":"https://api.github.com/users/panchoh/following{/other_user}","gists_url":"https://api.github.com/users/panchoh/gists{/gist_id}","starred_url":"https://api.github.com/users/panchoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panchoh/subscriptions","organizations_url":"https://api.github.com/users/panchoh/orgs","repos_url":"https://api.github.com/users/panchoh/repos","events_url":"https://api.github.com/users/panchoh/events{/privacy}","received_events_url":"https://api.github.com/users/panchoh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-22T04:33:01Z","updated_at":"2018-05-22T20:04:30Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/kewlfft/ansible-aur/pulls/4","html_url":"https://github.com/kewlfft/ansible-aur/pull/4","diff_url":"https://github.com/kewlfft/ansible-aur/pull/4.diff","patch_url":"https://github.com/kewlfft/ansible-aur/pull/4.patch"},"body":"As it is, aur.py depends on ansible being installed on the target host. So, you would need to get ansible installed in your target host just to be able to make use of aur.py and install whatever packages you need.\n\nLet's review the dependency:\n\n      from ansible.module_utils import six from six.moves import urllib\n\nI reckon that the six¹ package is there to isolate an ansible module's code from the particular major version of python being used (2 or 3).\n\nFortunately, since last week², the ansible package in archlinux now depends directly on python3, so I reckon that in this particular instance, we can safely import urllib.request directly, which from now on will be spot on.\n\nTo recap, current arch ships python3, and the arch ansible package depends on it to run. aur.py's purpose is to run on archlinux hosts, thus, python3 can be safely assumed to be available. So we can depend directly on it and relax the dependency on ansible itself.\n\nOn a personal note, I am using this nice module to help me bootstrap my arch systems, so not having to install ansible just to be able to use it makes my day a little better :-)\n\nThanks a bunch!\n\n[Feel free to edit the commit log]\n\n[1]: https://pythonhosted.org/six/ [2]: https://git.archlinux.org/svntogit/community.git/commit/trunk?h=packages/ansible&id=bb1a1cc822891387d5a8b3dad0d0ccdee94c0c51"},"comment":{"url":"https://api.github.com/repos/kewlfft/ansible-aur/issues/comments/391122513","html_url":"https://github.com/kewlfft/ansible-aur/pull/4#issuecomment-391122513","issue_url":"https://api.github.com/repos/kewlfft/ansible-aur/issues/4","id":391122513,"user":{"login":"panchoh","id":471059,"avatar_url":"https://avatars0.githubusercontent.com/u/471059?v=4","gravatar_id":"","url":"https://api.github.com/users/panchoh","html_url":"https://github.com/panchoh","followers_url":"https://api.github.com/users/panchoh/followers","following_url":"https://api.github.com/users/panchoh/following{/other_user}","gists_url":"https://api.github.com/users/panchoh/gists{/gist_id}","starred_url":"https://api.github.com/users/panchoh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/panchoh/subscriptions","organizations_url":"https://api.github.com/users/panchoh/orgs","repos_url":"https://api.github.com/users/panchoh/repos","events_url":"https://api.github.com/users/panchoh/events{/privacy}","received_events_url":"https://api.github.com/users/panchoh/received_events","type":"User","site_admin":false},"created_at":"2018-05-22T20:04:30Z","updated_at":"2018-05-22T20:04:30Z","author_association":"NONE","body":"Hi there!\r\n\r\nI just tried again, to make sure I hadn't dreamed it :-), and this is the error I got, when trying to use aur.py as it is now, when deploying a brand new host:\r\n```\r\nTraceback (most recent call last):\\n  File \\\"/tmp/ansible_p8rvxrp4/ansible_module_aur.py\\\", line 6, in <module>\\n    from six.moves import urllib\\nModuleNotFoundError: No module named 'six'\\ndebug3: mux_client_read_packet: read header failed: Broken pipe\\r\\ndebug2: Received exit status from master 1\r\n```\r\nNote the `No module named 'six'`.\r\n\r\nImporting `urllib.request` instead, works like a charm.\r\n\r\nSorry for the delay.  Long day.\r\n\r\nCheers!"}}
{"actor":{"display_login":"panchoh"}}