{"action":"opened","issue":{"url":"https://api.github.com/repos/saltstack/salt/issues/48307","repository_url":"https://api.github.com/repos/saltstack/salt","labels_url":"https://api.github.com/repos/saltstack/salt/issues/48307/labels{/name}","comments_url":"https://api.github.com/repos/saltstack/salt/issues/48307/comments","events_url":"https://api.github.com/repos/saltstack/salt/issues/48307/events","html_url":"https://github.com/saltstack/salt/issues/48307","id":335619647,"node_id":"MDU6SXNzdWUzMzU2MTk2NDc=","number":48307,"title":"salt-unity specification in setup.py doesn't work with pex","user":{"login":"nshalman","id":20391,"node_id":"MDQ6VXNlcjIwMzkx","avatar_url":"https://avatars1.githubusercontent.com/u/20391?v=4","gravatar_id":"","url":"https://api.github.com/users/nshalman","html_url":"https://github.com/nshalman","followers_url":"https://api.github.com/users/nshalman/followers","following_url":"https://api.github.com/users/nshalman/following{/other_user}","gists_url":"https://api.github.com/users/nshalman/gists{/gist_id}","starred_url":"https://api.github.com/users/nshalman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nshalman/subscriptions","organizations_url":"https://api.github.com/users/nshalman/orgs","repos_url":"https://api.github.com/users/nshalman/repos","events_url":"https://api.github.com/users/nshalman/events{/privacy}","received_events_url":"https://api.github.com/users/nshalman/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-06-26T00:58:50Z","updated_at":"2018-06-26T00:58:50Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### Description of Issue/Question\r\n\r\nWhen trying to build a [pex](/pantsbuild/pex) distribution of salt tied to the `salt-unity` script (to make it easy to use as a multipurpose distribution) we ran into an oddity.\r\n\r\n`setup.py` specifies\r\n```python\r\nsalt-unity = salt.scripts:salt_unity\r\n```\r\nBut the unity functions don't actually live in `salt/scripts.py`.\r\nThis makes pex sad:\r\n```\r\n$ ./dist/salt.pex.old minion --version\r\nTraceback (most recent call last):\r\n  File \".bootstrap/_pex/pex.py\", line 367, in execute\r\n  File \".bootstrap/_pex/pex.py\", line 293, in _wrap_coverage\r\n  File \".bootstrap/_pex/pex.py\", line 325, in _wrap_profiling\r\n  File \".bootstrap/_pex/pex.py\", line 410, in _execute\r\n  File \".bootstrap/_pex/pex.py\", line 468, in execute_entry\r\n  File \".bootstrap/_pex/pex.py\", line 482, in execute_pkg_resources\r\n  File \".bootstrap/pkg_resources/__init__.py\", line 2301, in resolve\r\nImportError: 'module' object has no attribute 'salt_unity'\r\n```\r\n\r\nBy moving the unity functions into a `salt/unity.py` and making some additional changes (pull request to follow for review) I was able to get it to work:\r\n```\r\n$ ./dist/salt.pex minion --version\r\nsalt-minion 2018.3.0-575-g16d19ce (Oxygen)\r\n```\r\n\r\nI specifically didn't move the code into scripts.py because if it's in there I don't think it can properly introspect itself to get the list of functions to determine what it can safely do.\r\n\r\nThe pex file was built with:\r\n```\r\npex -c salt-unity . -o dist/salt.pex\r\n```"}}
{"actor":{"display_login":"nshalman"}}