Last active
September 2, 2016 01:51
-
-
Save jmvrbanac/c7bd0bda105810a1cf7f to your computer and use it in GitHub Desktop.
Custom pip index per virtualenv (using virtualenvwrapper)
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 | |
| # This hook is sourced after every virtualenv is activated. | |
| # This belongs in $WORKON_HOME/postactivate | |
| VIRTUAL_ENV_NAME=${VIRTUAL_ENV##*/} | |
| if [[ $VIRTUAL_ENV_NAME == *"custom_prefix_"* ]] | |
| then | |
| export PIP_INDEX_URL="https://pypi.python.org/simple" | |
| else | |
| # Put this line in postdeactivate as well | |
| unset PIP_INDEX_URL | |
| fi |
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 | |
| # This hook is sourced after every virtualenv is deactivated. | |
| unset PIP_INDEX_URL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment