{"action":"created","issue":{"url":"https://api.github.com/repos/pypa/pipenv/issues/2238","repository_url":"https://api.github.com/repos/pypa/pipenv","labels_url":"https://api.github.com/repos/pypa/pipenv/issues/2238/labels{/name}","comments_url":"https://api.github.com/repos/pypa/pipenv/issues/2238/comments","events_url":"https://api.github.com/repos/pypa/pipenv/issues/2238/events","html_url":"https://github.com/pypa/pipenv/issues/2238","id":325121590,"node_id":"MDU6SXNzdWUzMjUxMjE1OTA=","number":2238,"title":"Environment activation on the shebang line?","user":{"login":"dansanderson","id":408973,"node_id":"MDQ6VXNlcjQwODk3Mw==","avatar_url":"https://avatars3.githubusercontent.com/u/408973?v=4","gravatar_id":"","url":"https://api.github.com/users/dansanderson","html_url":"https://github.com/dansanderson","followers_url":"https://api.github.com/users/dansanderson/followers","following_url":"https://api.github.com/users/dansanderson/following{/other_user}","gists_url":"https://api.github.com/users/dansanderson/gists{/gist_id}","starred_url":"https://api.github.com/users/dansanderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dansanderson/subscriptions","organizations_url":"https://api.github.com/users/dansanderson/orgs","repos_url":"https://api.github.com/users/dansanderson/repos","events_url":"https://api.github.com/users/dansanderson/events{/privacy}","received_events_url":"https://api.github.com/users/dansanderson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-22T02:43:56Z","updated_at":"2018-06-09T11:03:35Z","closed_at":"2018-05-23T19:29:21Z","author_association":"NONE","body":"I was inspired to ask about specifying the project dir as a command line arg (https://github.com/pypa/pipenv/issues/2237) while thinking about invoking tools in their own venvs. At some point I realized that I could use a venv's `python` to invoke a tool and it would just work without having to activate anything my shell. I assume this is entirely by design.\r\n\r\nWith pipenv managing venv paths, it might be compelling to be able to invoke a tool via pipenv, where pipenv would determine the venv from the tool's path and not the current working directory. Perhaps pipenv could be the tool runner on the shebang line, something like this:\r\n\r\n```\r\n#!/usr/bin/env pipenv run\r\n\r\nimport mystuff\r\nimport sys\r\n\r\ndef main(args):\r\n  # And so forth.\r\n  return 0\r\n\r\nif __name__ == '__main__':\r\n  sys.exit(main(sys.argv[1:]))\r\n```\r\n\r\nIs this compelling? Or am I missing a different best practice for organizing tools with their own venvs? Or do people just prefer to not do this and use global site-packages for everything they intend to run on their own machines? (And if I'm dev'ing my own tools, I would do actual releases into my everyday-carry environment, and use venvs just for development?)"},"comment":{"url":"https://api.github.com/repos/pypa/pipenv/issues/comments/395960353","html_url":"https://github.com/pypa/pipenv/issues/2238#issuecomment-395960353","issue_url":"https://api.github.com/repos/pypa/pipenv/issues/2238","id":395960353,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NTk2MDM1Mw==","user":{"login":"blixt","id":158591,"node_id":"MDQ6VXNlcjE1ODU5MQ==","avatar_url":"https://avatars0.githubusercontent.com/u/158591?v=4","gravatar_id":"","url":"https://api.github.com/users/blixt","html_url":"https://github.com/blixt","followers_url":"https://api.github.com/users/blixt/followers","following_url":"https://api.github.com/users/blixt/following{/other_user}","gists_url":"https://api.github.com/users/blixt/gists{/gist_id}","starred_url":"https://api.github.com/users/blixt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blixt/subscriptions","organizations_url":"https://api.github.com/users/blixt/orgs","repos_url":"https://api.github.com/users/blixt/repos","events_url":"https://api.github.com/users/blixt/events{/privacy}","received_events_url":"https://api.github.com/users/blixt/received_events","type":"User","site_admin":false},"created_at":"2018-06-09T11:03:35Z","updated_at":"2018-06-09T11:03:35Z","author_association":"NONE","body":"I just encountered issues with setting up tool scripts to just run within `pipenv` too. Here's the instructions I want to give to other people on my team, without them having to delve further into how the `pipenv` tool itself works (example below for a Mac):\r\n\r\n1. `brew install pipenv`\r\n2. `git clone git@example.com:tools.git`\r\n3. `cd tools && pipenv install`\r\n4. `./tool1.py`\r\n\r\nIs there a way to do that?"}}
{"actor":{"display_login":"blixt"}}