-
-
Save e3krisztian/65a15315dccd8ba5e7e2 to your computer and use it in GitHub Desktop.
pyd - give Python development shell with required packages already installed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| [ -e test-requirements.txt ] && { | |
| echo 'Entering Python environment as defined by test-requirements.txt' | |
| exec in-virtualenv -r test-requirements.txt /bin/bash "$@" | |
| } | |
| [ -e test_requirements.txt ] && { | |
| echo 'Entering Python environment as defined by test_requirements.txt' | |
| exec in-virtualenv -r test_requirements.txt /bin/bash "$@" | |
| } | |
| [ -e requirements.txt ] && { | |
| echo 'Entering Python environment as defined by requirements.txt' | |
| exec in-virtualenv /bin/bash "$@" | |
| } | |
| [ -e setup.py ] && { | |
| echo 'Entering Python environment as defined by setup.py' | |
| TMPREQ="$(mktemp)" | |
| echo '-e .' > "$TMPREQ" | |
| (sleep 2; rm "$TMPREQ") & | |
| exec in-virtualenv -r "$TMPREQ" --no-cache /bin/bash "$@" | |
| } | |
| echo 'Using default Python' | |
| exec /bin/bash "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment